The API is already supported by Chrome and Safari, joined now by Firefox

Jan 31, 2012 13:03 GMT  ·  By

Firefox 10 is about to land. One of the new features that Mozilla is boasting about is support for the Fullscreen API, part of the HTML5 standard. At this point, Firefox, Chrome and Safari all support the feature, meaning that developers can start leveraging it in their web apps.

"One thing which has been very important when it comes to creating special end user experiences have been the ability to show something fullscreen, effectively hiding all the other content etc," Mozilla Technical Evangelist Robert Nyman wrote.

"Some time ago we got fullscreen support in web browsers where the user could choose to view the current web site in fullscreen. That’s all good and well, but as an extension to that, as web developers we want to be able to trigger that. Either for the entire web site or just a specific element," he explained.

The Fullscreen API enables websites to request that the browser go full screen, for a better and more immersive experience. It should now work in all of these modern browsers, though the implementation differs a bit and strays away from the W3C proposed standard.

Firefox and Webkit browsers, Chrome and Safari, have implemented the "RequestFullscreen" method differently, you have to use the "moz" or the "webkit" prefixes.  In time, both rendering engines, Gecko and Webkit will probably drop the prefixes, once the implementation is stable enough.

The Fullscreen API also defines methods for detecting whether the browser is in fullscreen mode or not. There is also the possibility of styling and customizing the fullscreen window, via CSS.

Support for the Fullscreen API debuted with Firefox 10, which is about to land in the stable channel. It has also been available in Chrome 15+ and Safari 5.1. Developers wanting to play HTML5 video in fullscreen mode or run browser games in the same way now enjoy support from more than half the browser market.