2018-12-17 : 15:43
2018-12-06 : 10:53
2018-12-05 : 10:00
2018-12-04 : 15:14
2018-11-30 : 17:00
2019-01-18 : 11:01
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.