Tagged: stayawake.js


Preventing Mobile Browsers From Turning Off

The following code has been published which prevents a mobile browser from going into sleep mode. This was affecting setTimeout functions as the javascript code in the browser is effectively paused preventing the event loop from processing once sleep mode is activated. I originally looked at nosleep.js but ended up simplifying the code and putting it into a standard module for Vue.js https://github.com/jamesbachini/StayAwake.js The code works by looping through a...