3 ms·
This is probably because Firefox (and Chrome) clamps the setTimeout interval of background tabs to 1 second to improve performance.
by chengsun 13y ago
This is probably because Firefox (and Chrome) clamps the setTimeout interval of background tabs to 1 second to improve performance.
- mfincham 13y agoHuh? Is that new? Can I turn it off?
- chengsun 13y agoIt was introduced in Firefox 5 [1]. You can change it in about:config by tweaking "dom.min_background_timeout_value" to a lower value (in milliseconds). [1]: https://bugzilla.mozilla.org/show_bug.cgi?id=633421 https://bugzilla.mozilla.org/show_bug.cgi?id=633421
- crandles 13y agoI believe window.requestAnimationFrame is preferred over setInterval, and doesn't get limited as such. https://developer.mozilla.org/en-US/docs/Web/API/window.requestAnimationFrame https://developer.mozilla.org/en-US/docs/Web/API/window.requ...
- lewispollard 13y agoActually requestAnimationFrame is limited more (possibly even entirely paused) as it assumes that if the tab isn't visible, no animation needs to be requested