Background: I’m doing some user interface tests that need to detect if people are paying attention or not. But, this question is not about the page visibility API.
setTimeoutdelay is reduced when tabs are not active – seems like this just started appearing recently and can mess up Jasmine unit tests, around other things.
requestAnimationFrameis slowed when tab is not active (reasonable, can’t think of why this would affect anyone too much)
I have the following questions:
- Other than mobile browsers, do desktop browsers ever pause JS execution when a tab is not active? When and which browsers?
- Which browsers reduce the
setIntervalrepeat? Is it just reduced to a limit or by a percentage? For example, if I have a 10ms repeat versus a 5000ms repeat, how will each be affected?
- Do these changes happen if the window is out of focus, as opposed to just the tab? (I imagine it would be harder to detect, as it requires the OS API.)
- Are there any other effects that would not be observed in an active tab? Could they mess things up that would otherwise execute correctly (i.e. the aforementioned Jasmine tests)?