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.

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

onfullscreenerror = (event) => {};

Event type

A generic Event.

Examples

js
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

Specification
Fullscreen API
# handler-document-onfullscreenerror

Browser compatibility

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
fullscreenerror event

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
No support
No support
Requires a vendor prefix or different name for use.
Has more compatibility info.

See also