Document.mozFullScreen

Non-standard
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

Reports whether or not the document is currently displaying content in fullscreen mode.

Note that the draft specification of the fullscreen API does not include a document.fullscreen attribute, and instead suggests checking whether document.fullscreenElement is non-null to determine whether the browser is in fullscreen mode. Using document.fullscreenElement to dertermine whether the browser is in fullscreen mode is recommend.

Syntax

var isFullScreen = document.mozFullScreen || document.webkitIsFullScreen;

On return, isFullScreen is true if the document is being displayed in fullscreen mode; otherwise it's false.

Example

function isDocumentInFullScreenMode() {
  // Note that the browser fullscreen (triggered by short keys) might
  // be considered different from content fullscreen when expecting a boolean
  return ((document.fullscreenElement && document.fullscreenElement !== null) ||    // alternative standard methods
      document.mozFullScreen || document.webkitIsFullScreen);                   // current working methods
}

Notes

See Using fullscreen mode for details and examples.

Specifications

Not part of any specification.

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support ? 9.0 (9.0) ? ? ?
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support ? 9.0 (9.0) ? ? ?

See also

Document Tags and Contributors

 Last updated by: teoli,