safari timeout when tab/browser goes inactive

Safari 9.1 for El Capitan

Safari 10 for Sierra


What is Safari doing in the JavaScript engine with respect to setTimeout() when the browser or the tab loses focus?


I have created a simple JavaScript web application that I load in Safari that calls JavaScript setTimeout() that passes another function to be executed after the set interval. The function prints the date/time to the console, the calls setTimeout() on itself again.


If the Safari tab loses focus or the browser is minimized, after some time it seems Safari stops executing the setTimeout, and until focus is returned, no activity takes place.


NOTE: No function calls are lost, they are only paused, and restarted when the browser regains focus.


I do not notice this in Firefox, Chrome or IE11.

MacBook Pro (Retina, 13-inch,Early 2015), Mac OS X (10.7.5)

Posted on Jan 19, 2017 10:04 AM

Reply

There are no replies.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

safari timeout when tab/browser goes inactive

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.