4

Is it possible to force window to switch between normal and full-screen mode by JavaScript (no jQuery)..?

I know how to open a new window in full-screen, but that is not what I need.

Joe Frambach
  • 26,300
  • 10
  • 69
  • 98
Ωmega
  • 40,237
  • 31
  • 123
  • 190
  • Have you read this? http://www.sitepoint.com/html5-full-screen-api/#fbid=hhFRAbSolMC – Neil Jul 11 '12 at 15:45
  • @Neil - Nice, but I need Opera support (if possible). – Ωmega Jul 11 '12 at 15:49
  • possible duplicate of [How to make in Javascript full screen windows (stretching all over the screen)](http://stackoverflow.com/questions/1125084/how-to-make-in-javascript-full-screen-windows-stretching-all-over-the-screen) – kapa Jul 11 '12 at 15:54

2 Answers2

6

There's now a proper fullscreen API (first proposed by Mozilla and later released as a W3C proposal) has been implemented by Webkit (Safari 5.1+/Chrome 15+) and Firefox (10+). A brief history and usage examples here. Note that IE10 will allegedly not support the API.

josh3736
  • 131,871
  • 30
  • 208
  • 255
  • Any chance to send "F11" key to browser by script? – Ωmega Jul 11 '12 at 15:51
  • 1
    Nope. Script having the ability to control your keyboard would be a major security problem. You might be able to do something in an [extension](http://dev.opera.com/addons/extensions/), but that obviously requires an install. – josh3736 Jul 11 '12 at 15:53
2

You could try the experimental FullScreen API.

If you are not satisfied with the browser support, there is one more option: display a message to the user about how F11 switches to Fullscreen mode. Used this as a fallback option in a recent webapp I worked on, and the feedback was satisfactory.

kapa
  • 75,446
  • 20
  • 155
  • 173