The fullscreenerror event fires when the browser cannot switch to fullscreen. Learn onfullscreenerror, why requests fail, how it pairs with requestFullscreen() Promise rejection, and five try-it labs.
01
Kind
Instance event
02
Type
Event
03
When
Fullscreen request fails
04
Handler
onfullscreenerror
05
Also check
Promise .catch()
06
Status
Limited availability
Fundamentals
Introduction
Fullscreen is powerful—and often restricted. If requestFullscreen() is denied, the element does not go fullscreen. Instead you get a fullscreenerror event (and usually a rejected Promise).
Treat this event as your UX safety net: show a friendly message, offer a non-fullscreen fallback, and keep the rest of the app working. MDN marks it as Limited availability (not Baseline)—feature-detect and test.
💡
Beginner tip
The most common beginner mistake is calling requestFullscreen() outside a click/key handler. Many browsers deny that and fire fullscreenerror.
Concept
Understanding fullscreenerror
An instance event that answers: “Did the fullscreen mode change fail for this element?”
Fires when the browser cannot switch into (or sometimes out of) fullscreen.
Two deliveries — first to the Element, then to its Document (like fullscreenchange).
Not cancelable — you cannot force fullscreen by calling preventDefault().
Event type — a plain Event (no rich error code on the event itself).
Handler — onfullscreenerror or addEventListener("fullscreenerror", ...).
Limited availability on MDN (not Baseline)—test carefully.
Foundation
📝 Syntax
Use the event name with addEventListener, or set the handler property:
an error occurred changing into fullscreen
(Event object logged — request may fail without a user gesture)
How It Works
MDN’s sample calls requestFullscreen() immediately. In many browsers that fails and is a great way to see fullscreenerror fire.
Example 2 — onfullscreenerror Property
Update a status line when the handler property receives the event.
JavaScript
const el = document.getElementById("fs");
const out = document.getElementById("out");
el.onfullscreenerror = () => {
out.textContent = "fullscreenerror: could not change mode";
};
document.getElementById("bad").addEventListener("click", () => {
// Still may fail in some environments (iframe / policy)
el.requestFullscreen();
});
Calling requestFullscreen in 500ms without a gesture...
fullscreenerror (likely no user gesture / policy)
Promise also rejected.
How It Works
The button arms a timer; the delayed call is no longer a direct user gesture in many engines. Always request fullscreen synchronously inside the gesture handler when you can.
Example 5 — Friendly Error UI + Fallback
Show a message and keep a windowed “maximize” class as a fallback.
fullscreenerror is marked Limited availability on MDN (not Baseline). Logos use the shared browser-image-sprite.png sprite from this project. Pair it with feature detection and remember iframes / Permissions Policy can still block fullscreen even when the event exists.
✓ Limited availability
Element fullscreenerror
Failure signal for Fullscreen API requests; confirm support in your target browsers.
LimitedNot Baseline
Google ChromeSupported (check BCD / iframe policy)
Supported
Mozilla FirefoxSupported; may log console details
Supported
Apple SafariSupported with platform quirks
Supported
Microsoft EdgeSupported · Chromium
Supported
OperaSupported · Modern versions
Supported
Internet ExplorerNo modern Fullscreen API
No
fullscreenerrorLimited
Bottom line: Listen for fullscreenerror, catch Promise rejections, and always provide a fallback UX.
Wrap Up
Conclusion
fullscreenerror is the Fullscreen API’s failure signal. Listen for it, catch requestFullscreen() rejections, fix gesture / iframe / policy issues when you can, and always give users a clear fallback.
Set allow="fullscreen" on trusted iframes that need it
Offer a windowed maximize fallback
❌ Don’t
Assume every requestFullscreen() will succeed
Ignore unhandled Promise rejections
Expect the event object to include a rich error code
Assume Baseline Widely available status
Overwrite onfullscreenerror if you need multiple listeners
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about fullscreenerror
Fullscreen failed—handle the event and Promise; always fall back.
5
Core concepts
⚠️01
Failure
could not switch
Trigger
📄02
Event
plain Event
API
🔒03
Common cause
no user gesture
Gotcha
📤04
Also .catch()
Promise rejects
Pattern
🎯05
Limited avail.
not Baseline
Status
❓ Frequently Asked Questions
It fires when the browser cannot switch an element into (or sometimes out of) fullscreen mode. As with fullscreenchange, the event is sent to the Element first, then to its Document.
No. MDN does not mark it Deprecated, Experimental, or Non-standard. It has Limited availability (not Baseline), so always test the browsers you care about.
Common reasons: no user gesture, iframe without allow="fullscreen", Permissions Policy blocking fullscreen, unsupported content, or the browser denying permission.
A generic Event. The event is not cancelable and does not carry a rich error code — pair it with the Promise rejection from requestFullscreen() for details when available.
Either works. MDN notes two fullscreenerror events fire: first on the Element, then on the Document. Listening on document is handy for app-wide error UI.
Success path: requestFullscreen resolves and fullscreenchange fires. Failure path: the Promise rejects and fullscreenerror fires instead of a successful mode change.
Did you know?
Like fullscreenchange, MDN documents twofullscreenerror events: first on the Element that failed, then on the Document that owns it. A single document listener can cover your whole page.