Table of contents
- 1. Summary
- 2. Syntax
- 3. Example
- 4. Notes
- 5. Browser compatibility
- 6. Specification
- 7. See also
Summary
Reports whether or not full-screen mode is available. Full screen mode is available only for a page that has no windowed plug-ins in any of its documents, and if all <iframe>
elements which contain the document have their
mozallowfullscreen
attribute set.
Syntax
var isFullScreenAvailable = document.mozFullScreenEnabled;
On return, isFullScreenAvailable is true if the document can be put into full-screen mode.
Example
function requestFullScreen() {
if (document.mozFullScreenEnabled) {
videoElement.requestFullScreen();
} else {
console.log('your browser cannot use fullscreen right now');
}
}
Notes
See Using full-screen mode for details and examples.
Browser compatibility
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic support | ? | 10.0 (10.0) | ? | ? | ? |
| Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|
| Basic support | ? | 10.0 (10.0) | ? | ? | ? |
Specification
This method has been proposed in the specification draft http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html#dom-document-fullscreenenabled
Mozilla Developer Network