The Document.hidden
read-only property returns a Boolean value indicating if the page is considered hidden or not.
Syntax
var boolean = document.hidden
Examples
document.addEventListener("visibilitychange", function() { console.log( document.hidden ); // Modify behavior... });
Specifications
Specification | Status | Comment |
---|---|---|
Page Visibility (Second Edition) The definition of 'Document.hidden' in that specification. |
Recommendation | Initial definition |
Browser compatibility
[1] From Firefox 10 to Firefox 51 included, this property could be used prefixed with -moz-
. Since Firefox 56 it also returns true
in Firefox on Mac when the window is completely hidden by another non-translucent application.