dom / latest / document / fullscreenerror_event.html /

Document: fullscreenerror event

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 Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
fullscreenerror_event
71
18
79
12
12-14
64
10
11
58
15
12.1-15
6
71
≤37
71
18
64
10
50
14
12.1-14
12
Only available on iPad, not on iPhone.
10.0
1.0

See also

© 2005–2021 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