Document.onfullscreenerror
The Document.onfullscreenerror
property is an event handler for the fullscreenerror
event that is sent to the document when it fails to transition into full-screen mode after a prior call to Element.requestFullscreen()
.
Syntax
targetDocument.onfullscreenerror = fullscreenErrorHandler;
Value
An event handler for the fullscreenerror
event.
Example
This example attempts to call requestFullscreen()
outside of an event handler. Since requestFullscreen()
can only be called in response to user action, for security reasons, this will fail, causing the fullscreenerror
to be sent to the document.
document.onfullscreenerror = function ( event ) { displayWarning("Unable to switch into full-screen mode."); }; //.... document.documentElement.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 | |
onfullscreenerror |
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
- Fullscreen API
- Guide to the Fullscreen API
fullscreenerror
Document.onfullscreenchange
Element.onfullscreenerror
© 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/onfullscreenerror