Advertisement
Browser Features
Page Visibility API Demonstration
Detect when the browser tab is hidden or backgrounded.
Checking support...
Feature Not SupportedThis browser does not support the Page Visibility API Web API feature. Try testing in a modern browser (such as Chrome, Edge, Safari, or Firefox).
Advertisement
Interactive Input Workspace
Ready for input
Web API Execution Output
Result output will be displayed here after execution...
Native JavaScript Code Example (Zero Libraries)
document.addEventListener('visibilitychange', () => {
console.log(document.hidden);
});About the Page Visibility API Web API
Page Visibility API lets you determine current visibility state of a page.
Specification:W3C & WHATWG Web API Standard
Sponsored Content