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)