In the design of a javascript based web app I was concerned if my app would run on inactive windows on Android and IOS since is basically a webapp wrapped by a native app.

Does anyone know how these two Operating Systems Manage running javascript on inactive tabs?


1 Answer 1


For Windows Phone: tabs that are in the background are not given access to resources - so Javascript will not be running.

For android: The default browser does not allow this, but it is possible to install different browsers - so I can not say that this goes for every browser that you can install on the system. (I read that Opera does actually keep Javascript going on the background!) (EDIT: Chrome on android can play audio in the background since 2013). If I am not mistaken - your web-app could get put in the 'On-Pause' state and that would be why your javascript stops running. For more information on the android lifecycle, check out this graph: http://developer.android.com/images/activity_lifecycle.png)

iOS: Well it allows audio to be played from a web-app that does not have focus anymore.As for other events - I'm not sure and I do not have an iOS device at my disposal to test this right now - so someone else might want to correct me on this.

(EDIT: These things change every now and then of course - android especially has lots of different versions and the last I developed for was about a year ago - and it was a project that ran on a version of almost three years ago.. WP I'm pretty confident about since I'm a WP user - and iOS should really be verified by someone else!)


Not the answer you're looking for? Browse other questions tagged or ask your own question.