In JavaScript, the Document fullscreenerror event fires when the browser cannot switch to fullscreen mode (MDN). Like fullscreenchange, two events are delivered: first to the failing Element, then to its owning Document.
Register a listener with addEventListener. Check readiness and browser support before you rely on this event.
Syntax
Listen for fullscreenerror. Start with this line.
JavaScript
addEventListener("fullscreenerror", fn)
Call
What it does
addEventListener("fullscreenerror", fn)
Primary signature.
Built into the browser. Listen with document.addEventListener("fullscreenerror", …) — no import required.
Library declarations
JavaScript
addEventListener("fullscreenerror", fn)
Parameters
This member has no parameters beyond those shown in the signature.
Return Value
Return Value
Description
*
Fires as a Document event (listener receives the Event object).
JavaScript Examples
Example 1 — Listen on document
MDN style: handle fullscreen failures with a Document listener.
JavaScript
function handleError(event) {
console.error("an error occurred changing into fullscreen");
console.log(event.type); // "fullscreenerror"
}
document.addEventListener("fullscreenerror", handleError);
console.log("fullscreenerror listener attached");
Read fullscreenEnabled. Policy or embedding may disable fullscreen.
Check the method. Confirm requestFullscreen exists.
Gate the UI. Only show the control when both checks pass.
Still listen for errors. Even “enabled” requests can fail at runtime.
Compatibility
Browser Support
Documentfullscreenerror is part of the Fullscreen API. MDN marks it Limited availability (not Baseline). It is not Deprecated, Experimental, or Non-standard — still feature-detect in production.
✓ Limited availability · Not Baseline
Document fullscreenerror
Fires when the browser cannot enter fullscreen. Pair with requestFullscreen().catch(…).
LimitedFeature-detect required
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
Android WebViewSupported · Modern WebView
Full support
fullscreenerrorLimited
Bottom line: Support mirrors the Fullscreen API. Always check fullscreenEnabled, require a user gesture, allow fullscreen in iframes, and handle both the event and Promise rejection.
Frequently Asked Questions
It fires when the browser cannot switch to fullscreen mode. As with fullscreenchange, two fullscreenerror events are fired: first on the Element that failed, then on the Document that owns that element (MDN).
No. MDN does not mark Document fullscreenerror as Deprecated, Experimental, or Non-standard. It has Limited availability (not Baseline), so feature-detect and test the browsers you care about.
Common reasons: no user gesture, iframe without allow="fullscreen", Permissions Policy blocking fullscreen, unsupported context, or the browser denying permission (MDN Fullscreen API guide).
No. MDN states this event is not cancelable. You cannot force fullscreen with preventDefault().
Either works. MDN’s Document example listens on document — handy for app-wide error UI because the second delivery reaches Document.
Success path: requestFullscreen resolves and fullscreenchange fires. Failure path: the Promise rejects and fullscreenerror fires instead of a successful mode change.