Web features explorer

Page visibility

Widely available
Tags: api

The document.visibilityState and document.hidden properties tell you whether the page is visible to the user (for example, it's not minimized or in a background tab). To learn more, see Document: hidden property, Page Visibility API, Document: visibilitychange event at MDN.

Compatibility (view on caniuse.com)

Specifications