visibilityState

The Document.visibilityState read-only property returns the visibility of the document.

MDN Reference