Document: fullscreenEnabled property

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

The read-only fullscreenEnabled property on the Document interface indicates whether or not fullscreen mode is available.

fullscreen 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.

Value

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

Examples

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

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

Specifications

Specification
Fullscreen API
# ref-for-dom-document-fullscreenenabled①

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
fullscreenEnabled
Chrome – Full support
Chrome 20 (Release date: 2012-06-26)
prefix
prefix Implemented with the vendor prefix: webkit
Chrome – Full support
Chrome 71 (Release date: 2018-12-04)
footnote Full support
Edge – Full support
Edge 12 (Release date: 2015-07-29)
footnote Full support
Firefox – Full support
Firefox 10 (Release date: 2012-01-31)
altname
altname Alternate name: mozFullScreenEnabled
Firefox – Full support
Firefox 64 (Release date: 2018-12-11)
footnote Full support
Opera – No support
Opera 12.1 – 12.1 (Release date: 2012-11-20)
unknown Support unknown
Opera – Full support
Opera 15 (Release date: 2013-07-02)
prefix
prefix Implemented with the vendor prefix: webkit
Opera – Full support
Opera 58 (Release date: 2019-01-23)
footnote Full support
Safari – Full support
Safari 6 (Release date: 2012-07-25)
prefix
prefix Implemented with the vendor prefix: webkit
Safari – Full support
Safari 16.4 (Release date: 2023-03-27)
footnote Full support
Chrome Android – Full support
Chrome Android 25 (Release date: 2013-02-27)
prefix
prefix Implemented with the vendor prefix: webkit
Chrome Android – Full support
Chrome Android 71 (Release date: 2018-12-04)
footnote Full support
Firefox for Android – Full support
Firefox for Android 10 (Release date: 2012-01-31)
altname
altname Alternate name: mozFullScreenEnabled
Firefox for Android – Full support
Firefox for Android 64 (Release date: 2018-12-11)
footnote Full support
Opera Android – No support
Opera Android 12.1 – 12.1 (Release date: 2012-10-09)
unknown Support unknown
Opera Android – Full support
Opera Android 14 (Release date: 2013-05-21)
prefix
prefix Implemented with the vendor prefix: webkit
Opera Android – Full support
Opera Android 50 (Release date: 2019-02-18)
footnote Full support
Safari on iOS – Partial support
Safari on iOS 12 (Release date: 2018-09-17)
prefix
footnote Partial support
prefix Implemented with the vendor prefix: webkit
footnote Only available on iPad, not on iPhone.
Safari on iOS – Partial support
Safari on iOS 16.4 (Release date: 2023-03-27)
footnote Partial support
footnote Only available on iPad, not on iPhone.
footnote Shows an overlay button which can not be disabled. Swiping down exits fullscreen mode, making it unsuitable for some use cases like games.
Samsung Internet – Full support
Samsung Internet 1.5 (Release date: 2013-09-25)
prefix
prefix Implemented with the vendor prefix: webkit
Samsung Internet – Full support
Samsung Internet 10 (Release date: 2019-08-22)
footnote Full support
WebView Android – Full support
WebView Android 4.4 (Release date: 2013-12-09)
prefix
prefix Implemented with the vendor prefix: webkit
WebView Android – Full support
WebView Android 71 (Release date: 2018-12-04)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
No support
No support
Uses a non-standard name
Requires a vendor prefix or different name for use.
Has more compatibility info.

See also