2018-05-29 : 10:00
2018-05-27 : 23:17
2018-04-23 : 18:03
2018-04-06 : 14:55
2018-03-24 : 14:41
2018-09-25 : 01:29
We have the ability to easily make immersive fullscreen websites and applications, but like anything on the web there are a couple of ways to do it.
This is especially important now that more browsers are supporting an “installed web app” experience which launch fullscreen.
There are several ways that a user or developer can get a web app fullscreen.
Request the browser go fullscreen in response to a user gesture
Not all platforms are equal. iOS Safari doesn’t have a fullscreen API, but we do on Chrome on Android, Firefox, and IE 11+. Most applications you build will use a combination of the JS API and the CSS selectors provided by the fullscreen specification. The main JS API’s that you need to care about when building a fullscreen experience are:
element.requestFullscreen()(currently prefixed in Chrome, Firefox, and IE) displays the element in fullscreen mode.
document.exitFullscreen()(currently prefixed in Chrome, Firefox and IE. Firefox uses
cancelFullScreen()instead) cancels fullscreen mode.
document.fullscreenElement(currently prefixed in Chrome, Firefox, and IE) returns true if any of the elements are in fullscreen mode.