JavaScript Document fullscreenEnabled Property

Beginner
⏱️ 12 min read
📚 Updated: Jul 2026
🎯 5 Examples
🚀 5 Try-it labs
Limited availability
Instance property

What You’ll Learn

Document.fullscreenEnabled is a read-only instance property that tells you whether fullscreen mode is available for this document. Learn how to guard requestFullscreen(), how it differs from fullscreenElement, iframe allowfullscreen rules, and five examples with try-it labs.

01

Kind

Read-only property

02

Returns

boolean

03

Means

Can enter?

04

vs

fullscreenElement

05

Guard

Before request

06

Status

Limited avail.

Introduction

Before calling element.requestFullscreen(), it helps to know whether the browser will allow it. document.fullscreenEnabled answers that question with a simple true or false.

MDN: the read-only property indicates whether or not fullscreen mode is available. It is part of the Fullscreen API alongside fullscreenElement and the deprecated fullscreen flag.

💡
Limited availability

MDN marks this property Limited availability (not Baseline). It is not Deprecated, Experimental, or Non-standard—still feature-detect ("fullscreenEnabled" in document) before relying on it.

Related Document tutorials: fullscreenElement, fullscreen, Document constructor.

Understanding Document.fullscreenEnabled

A read-only instance property on Document that reports Fullscreen API availability—not whether fullscreen is currently active.

  • Valuetrue if the document and its elements can enter fullscreen via requestFullscreen(); otherwise false (MDN).
  • Plug-ins — MDN: unavailable when the page has windowed plug-ins in any of its documents.
  • Containers — MDN: unavailable if a containing element (for example an iframe) lacks the allowfullscreen attribute.
  • Lenient setter — assigning does not throw; the write is ignored (MDN).
  • Pair with — check before requestFullscreen(); use fullscreenElement to see active state.

📝 Syntax

JavaScript
document.fullscreenEnabled

Value

A boolean: true when fullscreen can be requested; false when it cannot (MDN).

MDN guard example

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

⚡ Quick Reference

GoalCode / note
Is fullscreen allowed?document.fullscreenEnabled
Guard before requestif (document.fullscreenEnabled) { ... }
Is fullscreen active?document.fullscreenElement !== null
Feature detect"fullscreenEnabled" in document
iframe noteParent needs allowfullscreen (MDN)
MDN statusLimited availability (not Baseline)

🔍 At a Glance

Four facts about document.fullscreenEnabled.

Type
boolean

Read-only

true
can enter

Available

false
blocked

Not allowed

Status
limited

Not Baseline

📋 fullscreenEnabled vs fullscreenElement

fullscreenEnabledfullscreenElement
TypebooleanElement | null
QuestionCan we enter fullscreen?What is fullscreen now?
Typical useEnable/disable UI buttonsToggle exit / inspect target
When false/nullAPI blocked for this documentNot currently in fullscreen

Examples Gallery

Examples follow MDN Document: fullscreenEnabled. On most top-level pages the value is true; embedded contexts may differ.

📚 Getting Started

Read the property and use MDN’s guard pattern.

Example 1 — Read fullscreenEnabled

Log whether fullscreen is available on this document.

JavaScript
console.log(document.fullscreenEnabled);
console.log("API available?", document.fullscreenEnabled === true);
Try It Yourself

How It Works

This is a capability check, not a state check. Fullscreen may be allowed even when nothing is currently fullscreen.

Example 2 — MDN: Guard requestFullscreen()

Avoid failed requests when fullscreen is not available.

JavaScript
const videoElement = document.querySelector("video");

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

How It Works

MDN recommends this guard so users see a clear message instead of a silent failure.

📈 UI, Compare & Detect

Wire buttons, compare with active state, and feature-detect safely.

Example 3 — Enable or Disable the Fullscreen Button

Hide or disable controls when the API is unavailable.

JavaScript
const btn = document.getElementById("fs-btn");

if (!document.fullscreenEnabled) {
  btn.disabled = true;
  btn.title = "Fullscreen is not available in this context";
} else {
  btn.addEventListener("click", () => {
    document.getElementById("stage").requestFullscreen();
  });
}
Try It Yourself

How It Works

Good UX: don’t show a broken fullscreen control in sandboxed iframes or blocked contexts.

Example 4 — Compare fullscreenEnabled and fullscreenElement

Allowed vs active—two different questions.

JavaScript
function reportFullscreenState() {
  return {
    enabled: document.fullscreenEnabled,
    active: document.fullscreenElement !== null,
    element: document.fullscreenElement
  };
}

console.log(reportFullscreenState());
Try It Yourself

How It Works

enabled: true with active: false is normal before the user clicks “Enter fullscreen”.

Example 5 — Feature Detect Before Use

Check the property exists, then read its value.

JavaScript
function canUseFullscreen() {
  return "fullscreenEnabled" in document && document.fullscreenEnabled;
}

console.log("canUseFullscreen:", canUseFullscreen());
Try It Yourself

How It Works

Because MDN marks the API Limited availability, combine existence checks with the boolean value.

🚀 Common Use Cases

  • Video players — guard MDN’s requestFullscreen() pattern before expanding video.
  • Games / canvases — hide fullscreen buttons when the API is blocked.
  • Embedded widgets — detect sandboxed or iframe contexts where MDN says availability may be false.
  • Progressive enhancement — offer a windowed fallback when false.
  • Diagnostics — log fullscreenEnabled alongside fullscreenElement during debugging.
  • Accessibility — explain why a control is disabled instead of failing silently.

🧠 How fullscreenEnabled Fits the Fullscreen API

1

Page loads

Browser evaluates whether fullscreen is allowed for this document.

Setup
2

You read fullscreenEnabled

true means requests may succeed; false means they will not (MDN rules).

Check
3

User clicks “Fullscreen”

Call requestFullscreen() only when enabled; handle errors anyway.

Request
4

Track active state separately

Use document.fullscreenElement and fullscreenchange to know what is fullscreen now.

📝 Notes

  • MDN: Limited availability (not Baseline) — no Deprecated / Experimental / Non-standard banner.
  • Unavailable with windowed plug-ins in any document (MDN).
  • Containing elements need allowfullscreen (MDN) — common iframe gotcha.
  • Setter is a no-operation and is ignored; assigning does not throw (MDN).
  • Related: fullscreenElement, fullscreen, Document constructor.

Browser Support

Document.fullscreenEnabled is marked Limited availability on MDN (not Baseline). Feature-detect before production use. Logos use the shared browser-image-sprite.png sprite from this project.

Limited availability · Not Baseline

Document.fullscreenEnabled

Read-only boolean — whether this document can enter fullscreen via the Fullscreen API.

Limited Check compat
Google Chrome Widely supported · Desktop & Mobile
Supported
Mozilla Firefox Supported in modern versions
Supported
Apple Safari Supported with Fullscreen API
Supported
Microsoft Edge Chromium support
Supported
Opera Follow Chromium behavior
Supported
Internet Explorer Not modern Fullscreen API
No / legacy only
Document.fullscreenEnabled Limited availability

Bottom line: Check fullscreenEnabled before requestFullscreen(). Pair with fullscreenElement for active state and fullscreenchange for UI sync.

Conclusion

Document.fullscreenEnabled tells you whether fullscreen mode is available before you call requestFullscreen(). Pair it with fullscreenElement for active state and handle iframe allowfullscreen requirements from MDN.

Continue with head, fullscreenElement, fullscreen, or the JavaScript hub.

💡 Best Practices

✅ Do

  • Check document.fullscreenEnabled before requesting fullscreen
  • Feature-detect with "fullscreenEnabled" in document
  • Disable or hide buttons when the API is unavailable
  • Set allowfullscreen on embedding iframes (MDN)
  • Still handle fullscreenerror after the guard

❌ Don’t

  • Confuse fullscreenEnabled with fullscreenElement
  • Assign to fullscreenEnabled hoping to enable the API
  • Assume every browser is Baseline for this property
  • Skip user feedback when fullscreen is blocked
  • Rely on deprecated document.fullscreen instead

Key Takeaways

Knowledge Unlocked

Five things to remember about document.fullscreenEnabled

Boolean availability check for the Fullscreen API.

5
Core concepts
02

true

Can enter

Allowed
🔒03

false

Blocked

MDN rules
🎬04

Guard

Before request

MDN
🔄05

vs

fullscreenElement

Allowed vs active

❓ 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 Document.fullscreenEnabled as 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 element (such as an 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 a failed request.
Did you know?

A page can report fullscreenEnabled: true while fullscreenElement is still null. The first means “you may request fullscreen”; the second means “nothing is fullscreen yet.”

Next: head

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

head →

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.

6 people found this page helpful