Bug in Tizen’s XMLHttpRequest for Wearable Web Widget

When switching networks (i.e. from WiFi to mobile network) or switching network for mobile and restart watch, the widget is not able to send requests to the server anymore due to the XMLHttpRequest class not working as it is supposed to. Besides, if I turn WiFi on, or re-add the widget everything work fine.

Testing on Tizen, Tizen, Tizen, Tizen

Here it is simple web widget code:

<!DOCTYPE html>
		<meta charset="UTF-8">
			window.onload = function() {
				document.addEventListener('visibilitychange', visibilitychange);


				function isInternet() {
					var xhr = new XMLHttpRequest();
					var file = 'https://jsonplaceholder.typicode.com/todos/1';
					var randNum = Math.round(Math.random() * 10000);

					xhr.open('GET', file + "?rand=" + randNum, false);

					try {

						if (xhr.status >= 200 && xhr.status < 304) {
							document.getElementById('message').textContent = 'internet';
					} catch (e) {
						document.getElementById('message').textContent = 'no internet';

				function visibilitychange() {
					if (document.visibilityState === 'visible') {
		<div style="text-align: center;">
			<div id="message"></div>

How to reproduce the error:

  1. Install the application with this code. Make sure both WiFi is enabled and your watch is tethered to your phone.
  2. Add the widget to your homescreen. It will show your ‘internet’ when widget can do requests.
  3. Turn off WiFi on your watch. Reboot watch.
  4. The widget will stop working, and show ‘no internet’ even though the watch is connected to the internet. Other apps can still connect to the internet. Once the widget is in this state, it seems not to be able to recover. Removing and re-adding the widget will have it working again.

Whats wrong? Is it Tizen bug?

The web widgets have a very stripped-down version of the webkit.
Apparently because of this, failures are frequent.
The problem you described with the Internet connection also applies to obtaining GPS coordinates.
I don’t think we can do anything about it.