6 ms·
Lot of people confused here -- the "running JavaScript when the browser is idle" part is a bit misleading. It doesn't run stuff when you're the tab is backgrou
by travisd 4y ago
Lot of people confused here -- the "running JavaScript when the browser is idle" part is a bit misleading.
It doesn't run stuff when you're the tab is backgrounded (browsers already heavily reduce what sites can do when not in focus[1]). Instead, it just lets you delay work until the page isn't doing anything else (such as rendering the page). For example, you might do this when updating a visualization on a page so that the other updates can complete first (e.g., update the input UI and redraw the visualization when that's done).
[1] https://blog.chromium.org/2020/11/tab-throttling-and-more-performance.html https://blog.chromium.org/2020/11/tab-throttling-and-more-pe...