The page has made noises in the past 30 seconds.This happens to timers that are scheduled when any of the following is true: The throttling happens in stages: # Minimal throttling log ( ` This is number $ in the chain ` )
This might be easier to understand with code: let chainCount = 0 Ĭonsole. With setInterval, each iteration is part of the chain.
If you call setTimeout in the same task as a setTimeout callback, the second invocation is 'chained'. Timers are useful, and they aren't going away, but sometimes they're used to poll state when an event would be more efficient, and more accurate. # JavaScript timersīy JavaScript timers I mean setTimeout and setInterval, which allow you to schedule a callback sometime in the future. Some browsers go further than others here, but you can always use the page visibility API to track when the browser thinks visibility has changed. Generally, hidden means a different tab is active, or the window has been minimized, but browsers may consider a page hidden whenever its content is totally not-visible. Let's dig in… # Terminology # Hidden pages OK, that was pretty jargon heavy, and a bit ambiguous. There are some edge cases where this will change behavior, but timers are often used where a different API would be more efficient, and more reliable. This will reduce CPU usage, which will also reduce battery usage. Chrome 88 (January 2021) will heavily throttle chained JavaScript timers for hidden pages in particular conditions.