Keeps frames coming while the page is hidden. A browser stops requestAnimationFrame in a hidden tab, and slows
setTimeout to once a second and then to nothing; a timer in a worker keeps its pace. So while the page is hidden and
someone holds the clock, a worker ticks about 60 times a second and each tick calls onTick(time); when the page is
visible again it stops, and requestAnimationFrame drives the frames as before.
Measured in Chrome 156 (macOS, 8.5 minutes hidden): about 62 ticks a second the whole time; setTimeout gave 1.6, then
0 from the third minute. A browser can still freeze a tab hidden for long (Chrome's Energy and Memory Saver).
As of November 2026, Safari pauses a hidden tab anyway (tried with a recording); Firefox and phones are not tested yet.
Rendering in the background uses the CPU and GPU, so hold it only for a task that needs it, like a recording.
Keeps frames coming while the page is hidden. A browser stops
requestAnimationFramein a hidden tab, and slowssetTimeoutto once a second and then to nothing; a timer in a worker keeps its pace. So while the page is hidden and someone holds the clock, a worker ticks about 60 times a second and each tick callsonTick(time); when the page is visible again it stops, andrequestAnimationFramedrives the frames as before.Measured in Chrome 156 (macOS, 8.5 minutes hidden): about 62 ticks a second the whole time;
setTimeoutgave 1.6, then 0 from the third minute. A browser can still freeze a tab hidden for long (Chrome's Energy and Memory Saver). As of November 2026, Safari pauses a hidden tab anyway (tried with a recording); Firefox and phones are not tested yet. Rendering in the background uses the CPU and GPU, so hold it only for a task that needs it, like a recording.Does nothing where there is no
documentorWorker(Node.js). Used by RenderManager.keepRenderingWhenHidden.