The test logs the actual time it takes for a setInterval and requestAnimationFrame to run in different browsers, and gives you the results in the form of a distribution. requestAnimationFrame is not supported by IE 9- and Opera 12. I have written a test specifically for this purpose:įrame Rate Distribution: setInterval vs requestAnimationFrame 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.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.).Which browsers reduce the setInterval repeat? 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?.Other than mobile browsers, do desktop browsers ever pause JS execution when a tab is not active? When and which browsers?.requestAnimationFrame is slowed when tab is not active (reasonable, can't think of why this would affect anyone too much).setInterval and setTimeout delay is reduced when tabs are not active - seems like this just started appearing recently and can mess up Jasmine unit tests, around other things.ios 5 pauses javascript when tab is not active.Specifically, I would like to know how my Javascript code will be affected if the current tab is not active, or the browser window is not active, in different browsers. But, this question is not about the page visibility API. Background: I'm doing some user interface tests that need to detect if people are paying attention or not.
0 Comments
Leave a Reply. |