is there a javascript script that auto fullscreen mode the browser? example if you visit my site, the browser will auto fullscreen upon load..
-
10If you did this I would invent the technology to punch you in the face through the internet. – Incognito Jul 06 '10 at 00:33
-
This question is a duplicate of http://stackoverflow.com/questions/1125084/how-to-make-in-javascript-full-screen-windows-stretching-all-over-the-screen. – Anderson Green Jun 03 '13 at 23:55
2 Answers
Please, don't do this. You shouldn't resize the browser, that's the user's choice to make.
If I have my browser at a certain size, and your site is one of 20 tabs, why should the other 20 be resized?
If you're using window.open()
to open a new window and want to specify a size, that's fine, but don't resize the browser. Most browsers actively block this, for a reason.

- 623,446
- 136
- 1,297
- 1,155
-
@vrynxzent - Welcome :) There are *many* alternatives out there, differently sized layouts, static/dynamic layouts, fluid width, etc...see which works, resizing isn't the only way to tackle the problem :) – Nick Craver Jul 06 '10 at 00:14
-
1@vrynxzent – …and I even discourage the use of `window.open`; I really hate popups and if you just throw a large window, occupying the entire screen, in my face without obvious reason, when visiting your site, I'm very inclined to close it as soon as possible and *never* come back. ;-) – Marcel Korpel Jul 06 '10 at 00:20
I looked into this once and like Nick said browsers do not allow you to control setting fullscreen for security reasons e.g. think malicious website recreating the toolbar to trick users. The closest you can get to it is explaining to the user in a ribbon or popup the first time they visit, how to get to fullscreen and letting them make the decision. Then the trick is check for the keypress on f11 assuming that's how you had the user do it.
The only place I wish it was allowed for the site to go fullscreen is webapps.

- 6,236
- 6
- 33
- 62
-
good point about webapp, I am currently have this issue, but it seems that F11 button is the only solution. – Mike Oct 02 '10 at 18:43