The Document.hidden read-only property returns a Boolean value indicating if the page is considered hidden or not.
var boolean = document.hidden
document.addEventListener("visibilitychange", function() {
console.log( document.hidden );
// Modify behavior...
});
| Specification | Status | Comment |
|---|---|---|
| Page Visibility (Second Edition) The definition of 'Document.hidden' in that specification. | Recommendation | Initial definition |
| Desktop | ||||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
| Basic support | 33
|
Yes | 18
|
10 | 12.1 | 7 |
| Mobile | |||||||
|---|---|---|---|---|---|---|---|
| Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
| Basic support | Yes | Yes | Yes | 18
|
12.1 | 7 | ? |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/document/hidden