Nos bénévoles n'ont pas encore traduit cet article en Français. Inscrivez-vous et aidez-nous à réaliser cette tâche !
Vous pouvez également lire cet article en English (US).

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

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic supportChrome Full support 33
Full support 33
Full support 13
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge Full support YesFirefox Full support 18
Notes
Full support 18
Notes
Notes Since Firefox 56 it also returns true on Mac when the window is completely hidden by another non-translucent application.
No support 10 — 52
Prefixed
Prefixed Implemented with the vendor prefix: -moz-
IE Full support 10Opera Full support 12.1Safari Full support 7WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 18
Notes
Full support 18
Notes
Notes Since Firefox 56 it also returns true on Mac when the window is completely hidden by another non-translucent application.
No support 10 — 52
Prefixed
Prefixed Implemented with the vendor prefix: -moz-
Opera Android Full support 12.1Safari iOS Full support 7Samsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown
See implementation notes.
See implementation notes.
Requires a vendor prefix or different name for use.
Requires a vendor prefix or different name for use.

Étiquettes et contributeurs liés au document

Contributeurs à cette page : fscholz, aleclarson, Bzbarsky, Sebastianz, teoli
Dernière mise à jour par : fscholz,