lab / experiment

Background Process

A process that only runs while you're looking somewhere else. Leave the tab and it works in the tab's title and icon; come back and it tells you what it did.

published
2026-10-30
status
wip
stack
TypeScript · React · Page Visibility API
livewip
notes

Only while you're away

Most pages want you to stay: they autoplay, notify, and count your time on site. This one turns that around. It does nothing while you watch, and it runs for five minutes of your time elsewhere, across as many absences as you like.

The tab is the screen

While the tab is hidden, its title is a ten-block progress bar and its icon is a bar drawn on a canvas in the site's bone and black. Both update every second. Browsers slow down timers in background tabs, so the tick comes from a small Web Worker, and the progress is worked out from the clock rather than counted, so a late tick never loses time.

The Page Visibility API says when you leave and come back. When you return, the title and icon go back to normal, and the log lines you missed glitch in at the times they happened.

Nothing kept

The progress lives in this page only. Reload and the process starts again from zero.