In JavaScript, the Document fullscreenchange event fires immediately after the browser switches into or out of fullscreen mode (MDN). It is sent to the transitioning Element, then bubbles up to Document.
Register a listener with addEventListener. Check readiness and browser support before you rely on this event.
Syntax
Listen for fullscreenchange. Start with this line.
JavaScript
addEventListener("fullscreenchange", fn)
Call
What it does
addEventListener("fullscreenchange", fn)
Primary signature.
Built into the browser. Listen with document.addEventListener("fullscreenchange", …) — no import required.
Library declarations
JavaScript
addEventListener("fullscreenchange", fn)
Parameters
Parameter
Description
Listener on document
Required. Catches bubbled enter/exit changes
fullscreenElement
Required. Current fullscreen node, or null
Return Value
Return Value
Description
*
Fires as a Document event (listener receives the Event object).
JavaScript Examples
Example 1 — Listen on document
MDN style: after the change, read fullscreenElement to know enter vs exit.
fullscreenEnabled: true
Fullscreen API usable: true
How It Works
Read fullscreenEnabled. Policy / embedding may disable fullscreen.
Check the method. Confirm requestFullscreen exists on an element.
Combine both. Only then treat the API as usable.
Degrade gracefully. Hide the control when support is missing.
Compatibility
Browser Support
Documentfullscreenchange is part of the Fullscreen API. MDN marks it Limited availability (not Baseline). It is not Deprecated, Experimental, or Non-standard — still feature-detect in production.
✓ Limited availability · Not Baseline
Document fullscreenchange
Fires after enter/exit fullscreen. Read document.fullscreenElement to know the direction.
LimitedFeature-detect required
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
Android WebViewSupported · Modern WebView
Full support
fullscreenchangeLimited
Bottom line: Works in many modern browsers, but support and policy vary (especially in iframes). Always check document.fullscreenEnabled and handle fullscreenerror.
Frequently Asked Questions
It fires immediately after the browser switches into or out of fullscreen mode. The event is sent to the Element that is transitioning, then bubbles up to the Document (MDN).
No. MDN does not mark Document fullscreenchange as Deprecated, Experimental, or Non-standard. It has Limited availability (not Baseline), so feature-detect and test the browsers you care about.
After the event fires, check document.fullscreenElement. If it is non-null, an element is in fullscreen. If it is null, fullscreen mode was exited (MDN).
No. MDN states this event is not cancelable. It reports a change that already happened.
Call element.requestFullscreen() to enter (usually from a user gesture). Call document.exitFullscreen() to exit — exitFullscreen is only available on Document. Listen for fullscreenchange to update your UI.
Listen for the fullscreenerror event. Failures often happen without a user gesture, in unsupported browsers, denied iframes, or when the browser refuses permission.