3 ms·
"With the visibility API, you can gracefully pause or degrade the timer to a much longer poll when the tab is in the background." Note that this is already enf
by sbirch 15y ago
"With the visibility API, you can gracefully pause or degrade the timer to a much longer poll when the tab is in the background."
Note that this is already enforced for setInterval in some browsers -- I think Chrome changes the minimum interval to 1000ms from 4ms when the tab is in the background.
- igrigorik 15y agoAh, interesting -- is this documented anywhere? I did see mentions of Chrome downgrading background tabs, but did not find any specific numbers.
- shazow 15y agoHere's the corresponding bit for Mozilla: https://bugzilla.mozilla.org/show_bug.cgi?id=633421 https://bugzilla.mozilla.org/show_bug.cgi?id=633421 I definitely experienced the same in Chromium. Once upon a time, I also experienced similar timing weirdness on inactive tabs with .gif animations for some version of Chromium (tab out, wait a few seconds, tab back and suddenly the animation is superfast for a few seconds) but I can't reproduce it with modern versions. Update: Here's the Chromium one: http://codereview.chromium.org/6577021 http://codereview.chromium.org/6577021
- paulirish 15y agoI mentioned it quickly on twitter: https://twitter.com/#!/ChromiumDev/status/76634744607096832 https://twitter.com/#!/ChromiumDev/status/76634744607096832 And updated the MDC docs on it: https://developer.mozilla.org/en/DOM/window.setTimeout#Minimum_delay_and_timeout_nesting https://developer.mozilla.org/en/DOM/window.setTimeout#Minim... I'll get it added to www.chromestatus.com now.