Chrome 88+ Will Throttle Timers to 1 Minute in Certain Conditions

Browser News

Starting from Chrome 88, chained JavaScript timers for hidden pages will throttled to 1 minute in particular conditions.

All of the following conditions need to be true in order for the 1 minute throttling to happen :

  • Page has been hidden for more than 5 minutes.
  • Chain count while applying setTimeout() / setInterval() methods is greater than 5.
  • Page has not made any sound using any of the sound-making APIs.
  • WebRTC is not in use.

Workaround

To work around this limit, browsers usually have alternative & better performing APIs to do the same thing :

  • Using requestAnimationFrame() to perform animations.
  • Using IntersectionObserver to find whether element has entered viewport.
  • Using ResizeObserver to find whether size of element changes.
  • Using MutationObserver to find whether the DOM changes.
  • Using web sockets, server-sent events, push messages, or fetch streams instead of polling the server.

Read full blog post on developer.chrome.com

January 19, 2021

Comments

Loading Comments