This module injects APIs to the DOM.
So, you don't have to consider about the prefix such as 'moz' or 'webkit'.
The implementation follows the standard specification at
Fullscreen API - WHATWG.
See also this project page.
- fullscrn.js - The script to include by script tag.
- fullscrn.min.js - Minified one.
- index.js - The source file of this module.
This can be import using browserify.
APIs Injected to DOM
- Document.fullscreenEnabled -
The full screen API's availability.
- Document.fullscreenElement -
Indicates the full sized element.
- Document.fullscreen -
The equivalent value to (Document.fullscreenElement != null).
These methods returns promise.
- Element.requestFullscreen() -
Requests the fullscreen mode with the element.
- Document.exitFullscreen() -
Cancels the fullscreen mode of the element that
is set to fullscreen at the time.
document.addEventListener to handle events while
this module does not supoort the event handlers -
Document.onfullscreenchange and onfullscreenerror.
sample/injected.html [live sample].
Exported APIs (according to the convention of Node.js)
If this module was included by script tag, the global object 'Fullscreen'
is available (see the
- Fullscreen.enabled - indicates the fullscreen APIs are available.
- Fullscreen.element - references the fullscreen element or null.
- Fullscreen.request(element) - enter full screen mode with the element and returns a promise.
- Fullscreen.exit(): exit full screen mode and returns a promise.
sample/sample.html [live sample].
This software is released under the MIT License, see LICENSE