JavaScript Document fullscreenEnabled Property

Beginner
5 min read
Updated: Nov 2026
3 examples
Property

Definition

Document.fullscreenEnabled is a read-only Boolean that is true when fullscreen mode is available for this document (you may call Element.requestFullscreen()), otherwise false (MDN).

Read the notes below before you get or set this property. Prefer feature detection when support is limited.

Syntax

Use document.fullscreenEnabled. Start with this line.

JavaScript
document.fullscreenEnabled
CallWhat it does
document.fullscreenEnabledPrimary signature.

Built into the browser. Read or assign document.fullscreenEnabled — no import required.

Library declarations
JavaScript
document.fullscreenEnabled

Parameters

ParameterDescription
allowfullscreen on iframesOptional. Required for iframe documents (MDN)

Return Value

Return ValueDescription
*Boolean (true / false)

JavaScript Examples

Example 1 — Read fullscreenEnabled

Log whether fullscreen is available in the current document.

JavaScript
console.log(document.fullscreenEnabled);
// true or false
Try It Yourself

How It Works

  1. Read the Boolean. No arguments — access document.fullscreenEnabled.
  2. Interpret true. The document may call requestFullscreen().
  3. Interpret false. Do not offer fullscreen (or explain why).
  4. Context matters. An iframe without allowfullscreen may report false.

Example 2 — Guard Before requestFullscreen() (MDN)

Check availability first, then enter — or log a friendly message.

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

// Demo without a real video element:
if (document.fullscreenEnabled) {
  console.log("Fullscreen is available — safe to call requestFullscreen().");
} else {
  console.log("Your browser cannot use fullscreen right now");
}
Try It Yourself

How It Works

  1. Gate the call. Only request fullscreen when the flag is true.
  2. Avoid failed attempts. When false, skip requestFullscreen().
  3. Tell the user. MDN’s message pattern keeps UX clear.
  4. Still need a gesture. Browsers usually require a click even when enabled.

Example 3 — Enabled vs Currently Active

Availability (fullscreenEnabled) is not the same as “in fullscreen now.”

JavaScript
const allowed = document.fullscreenEnabled;
const active = document.fullscreenElement !== null;

console.log(allowed);  // can we enter?
console.log(active);   // are we in fullscreen now?

// Common combo: allowed && !active → show "Enter fullscreen"
Try It Yourself

How It Works

  1. Read capability. fullscreenEnabled answers “is the API allowed?”
  2. Read state. fullscreenElement !== null answers “are we fullscreen?”
  3. Typical combo. Allowed + not active → show an Enter control.
  4. Do not mix them up. A page can be allowed and still not currently fullscreen.

Browser Support

Document.fullscreenEnabled is marked Limited availability on MDN (not Baseline). It is not Deprecated, Experimental, or Non-standard — still feature-detect in production.

✓ Limited availability · Not Baseline

Document.fullscreenEnabled

Read-only Boolean — true when Element.requestFullscreen() is allowed for this document.

Ltd Limited availability
Google Chrome All versions · Desktop & Mobile
Full support
Mozilla Firefox All versions · Desktop & Mobile
Full support
Apple Safari All versions · macOS & iOS
Full support
Microsoft Edge All versions · Chromium & Legacy
Full support
Internet Explorer IE 6+ · Legacy environments
Full support
Opera All modern versions
Full support
fullscreenEnabled Limited

Bottom line: Check document.fullscreenEnabled before calling requestFullscreen(). Pair with fullscreenElement for current state, and listen for fullscreenchange / fullscreenerror.

Frequently Asked Questions

A boolean: true if the document and its elements can enter fullscreen via Element.requestFullscreen(), or false if fullscreen mode is not available (MDN).
No. MDN does not mark it Deprecated, Experimental, or Non-standard. It is Limited availability (not Baseline), so feature-detect in production.
fullscreenEnabled asks whether fullscreen is allowed at all. fullscreenElement tells you which element (if any) is currently in fullscreen.
MDN: when the page has windowed plug-ins in any of its documents, or when a containing iframe lacks the allowfullscreen attribute.
The property is read-only, but assigning does not throw — even in strict mode. The setter is a no-operation and is ignored (MDN).
Yes. MDN recommends checking it first so you can show a friendly message instead of attempting a request that cannot succeed.

Next: head

Learn how to access the document’s <head> element.

head tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

11 people found this page helpful