W3cubDocs

/DOM

document.fullscreenEnabled

The read-only fullscreenEnabled property on the Document interface indicates whether or not full-screen mode is available. Full-screen mode is available only for a page that has no windowed plug-ins in any of its documents, and if all <iframe> elements which contain the document have their allowfullscreen attribute set.

Although this property is read-only, it will not throw if it is modified (even in strict mode); the setter is a no-operation and it will be ignored.

Syntax

var isFullscreenAvailable = document.fullscreenEnabled;

Value

A Boolean value which is true if the document and the elements within can be placed into full-screen mode by calling Element.requestFullscreen(). If full-screen mode isn't available, this value is false.

Example

In this example, before attempting to request full-screen mode for a video element, the value of fullscreenEnabled is checked, in order to avoid making the attempt when not available.

function requestFullScreen() {
  if (document.fullscreenEnabled) {
    videoElement.requestFullScreen();
  } else {
    console.log('Your browser cannot use fullscreen right now');
  }
}

Specifications

Specification Status Comment
Fullscreen API
The definition of 'Document.fullscreenEnabled' in that specification.
Living Standard Initial definition

Browser compatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
Basic support 45
45
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
? 64
64
47
Disabled
Disabled From version 47: this feature is behind the full-screen-api.unprefix.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
10
Uses the non-standard name: mozFullScreenEnabled
11
11
Uses the non-standard name: msFullScreenEnabled
? ?
Mobile
Android webview Chrome for Android Edge Mobile Firefox for Android Opera for Android iOS Safari Samsung Internet
Basic support 45
45
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
45
45
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
? 64
64
47
Disabled
Disabled From version 47: this feature is behind the full-screen-api.unprefix.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
10
Uses the non-standard name: mozFullScreenEnabled
? ? ?

See also

© 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/fullscreenEnabled