Let's imagine I have a website with a simple javascript:
t = setInterval( callback, 30*1000 );
var callback = function() {
document.write('foobar');
};
If a user visits my site from a mobile device, I'm wondering whether the callback will continue to execute after the page/app is in the background. I know that all mobile devices are not the same, so for clarity let's identify some specific scenarios:
- iOS device using Mobile Safari
- iOS device using native app with a UIWebView
- Android device in default internet app
- Android device using native app with WebView
In which (if any) of these cases would the user return after an hour to the screen full of foobar
s?
update
- iOS 8+ (just released at the time of writing this) according to this guy:
now JavaScript continues executing even being the inactive tab (timers are slowed down to 1s frequency) and even being Safari in the background.