jargon

Frontend & browser·Storage and platform APIs

you stopped the polling when the tab went to the background and started it again when it came back.

Page visibility

Also calledvisibilitychange, document.hidden

An event and property telling you whether the page is currently visible, which is how you avoid doing work for a tab nobody is looking at. It is also the reliable place to flush state before the page goes away, because `visibilitychange` to hidden is the last event guaranteed to fire on mobile. `unload` and `beforeunload` are not reliable and disable the back-forward cache into the bargain.

Commonly confused with