According to this article Google Chrome 15 has a fullscreen JavaScript API.
I have tried to make it work but failed. I have also searched for official documentation in vain.
What does the fullscreen JavaScript API look like?
The Fullscreen API adds methods to present a specific Element (and its descendants) in fullscreen mode, and to exit fullscreen mode once it is no longer needed.
To go full screen on Google Chrome, click the full screen mode icon in its hamburger menu. You can also enter full screen by pressing "F11" on PC or "Control + Command + F" on Mac. Mac users can also press the "expand window" button to enter or exit full screen in Chrome.
The quickest way to get Chrome in full-screen mode in Windows is to press F11 on the keyboard. The other way is through the Chrome menu: In the upper-right corner of Chrome, select the menu (three-dot) icon. In the Zoom section, select the square icon on the right.
Full-screen can be activated for the whole browser window by pressing the F11 key. It can be exited by pressing the Esc button. It is also possible to make a specific element in the page to enter and exit full-screen mode programmatically using Javascript Fullscreen API.
The API only works during user interaction, so it cannot be used maliciously. Try the following code:
addEventListener("click", function() { var el = document.documentElement, rfs = el.requestFullscreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullscreen ; rfs.call(el); });
I made a simple wrapper for the Fullscreen API, called screenfull.js, to smooth out the prefix mess and fix some inconsistencies in the different implementations. Check out the demo to see how the Fullscreen API works.
Recommended reading:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With