W3cubDocs

/Web APIs

Document: fullscreenerror event

Limited availability

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

The fullscreenerror event is fired when the browser cannot switch to fullscreen mode.

As with the fullscreenchange event, two fullscreenerror events are fired; the first is sent to the Element which failed to change modes, and the second is sent to the Document which owns that element.

For some reasons that switching into fullscreen mode might fail, see the guide to the Fullscreen API.

This event is not cancelable.

Syntax

Use the event name in methods like addEventListener(), or set an event handler property.

addEventListener("fullscreenerror", (event) => { })

onfullscreenerror = (event) => { }

Event type

A generic Event.

Examples

const requestor = document.querySelector("div");

function handleError(event) {
  console.error("an error occurred changing into fullscreen");
  console.log(event);
}

document.addEventListener("fullscreenerror", handleError);
// or
document.onfullscreenerror = handleError;

requestor.requestFullscreen();

Specifications

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
fullscreenerror_event 7118 791212–14 6410 581512.1–15 16.46 7118 6410 501412.1–14
16.4["Only available on iPad, not on iPhone.", "Shows an overlay button which can not be disabled. Swiping down exits fullscreen mode, making it unsuitable for some use cases like games."]
12Only available on iPad, not on iPhone.
10.01.0 714.4 No

See also

© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Document/fullscreenerror_event