Hacker News new | ask | show | jobs
by chengsun 4599 days ago
This is probably because Firefox (and Chrome) clamps the setTimeout interval of background tabs to 1 second to improve performance.
1 comments

Huh? Is that new? Can I turn it off?
It 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

I believe window.requestAnimationFrame is preferred over setInterval, and doesn't get limited as such.

https://developer.mozilla.org/en-US/docs/Web/API/window.requ...

Actually requestAnimationFrame is limited more (possibly even entirely paused) as it assumes that if the tab isn't visible, no animation needs to be requested