Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force full screen in Chrome

I am currently working on a private web application that is not going to be released to the public. It is relatively straightforward and will run on Google Chrome.

Does anyone have a solution for forcing the browser to enter Full Screen Mode when the DOM is ready? I was thinking to simply simulate the keypress of the F11 key, but I don't know if this is possible.

Does anyone have a jQuery solution, other than resizing the window to the available width and hiding the navigation (not an ideal solution).

like image 507
BenM Avatar asked Nov 14 '11 19:11

BenM


People also ask

How do I force my browser to full screen?

Full-screen can be activated for the whole browser window by pressing the F11 key. It can be exited by pressing the Esc button.

How do I get full screen instead of F11?

If you use a laptop or convertible device with an Fn key on the keyboard, you might have to press Fn + F11 instead of F11. An alternative way to get into full-screen mode in Google Chrome is to open its menu from the top-right side of the window.


1 Answers

As stated by others this isn't possible for obvious reasons already mentioned.

Although since it is a local site why don't you just create a Chrome shortcut for it in fullscreen:

Create a shortcut to Chrome:

"C:\Users\techiecorner\AppData\Local\Google\Chrome\Application\chrome.exe" --kiosk http://www.example.com

http://www.techiecorner.com/1941/how-to-auto-start-chrome-in-full-screen-mode-f11-everytime/

UDPATE

By now (HTML5) there is a proposal for a full screen API. To use this you could do something like:

// feature detection
if (typeof document.cancelFullScreen != 'undefined' && document.fullScreenEnabled === true) {
  // mozilla proposal
  element.requestFullScreen();
  document.cancelFullScreen(); 

  // Webkit (works in Safari and Chrome Canary)
  element.webkitRequestFullScreen(); 
  document.webkitCancelFullScreen(); 

  // Firefox (works in nightly)
  element.mozRequestFullScreen();
  document.mozCancelFullScreen(); 

  // W3C Proposal
  element.requestFullscreen();
  document.exitFullscreen();
}

For more information see the official specs.

like image 53
PeeHaa Avatar answered Sep 26 '22 18:09

PeeHaa