James Bachini

mobile browser

  • Prevent Mobile Browsers From Turning Off

    Prevent Mobile Browsers From Turning Off

    The following code has been published to prevent mobile browsers from turning off and 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…