On Wednesday, October 15, 2014 1:36:06 PM UTC+2, Jan Jongboom wrote:
> I have the following code running in system:
>
>
>
> var _iv;
>
>
>
> navigator.requestWakeLock('cpu');
>
> navigator.requestWakeLock('screen');
>
> navigator.requestWakeLock('wifi');
>
>
>
> window.on('online', () => {
>
> _iv = setInterval(ping, 1500);
>
> });
>
> window.on('offline', () => clearInterval(_iv));
>
>
>
> function ping() {
>
> var x = new XMLHttpRequest({ mozSystem: true });
>
> x.open('GET', 'http://janjongboom.com/yolo123?' + (+new Date));
>
> x.send();
>
> }
>
>
>
> When I now turn off the screen via |navigator.mozPower.screenEnabled = false|
> it will stop executing my code anyway (need to not be connected to USB). It
> also does not show up anymore in ADB when I re-plug it into USB...
>
>
>
> What am I missing?
(same thing happens if I use mozAlarms instead of setInterval by the way)
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g