is there a javascript script that auto fullscreen mode the browser? example if you visit my site, the browser will auto fullscreen upon load..
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.
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.
Related
I need to implement the following feature and make it work in Internet Explorer:
User clicks a link in the primary screen.
A popup will be opened in the secondary screen and in fullscreen mode.
Some requirements:
It must work in IE8 (and 9/10)
For simplicity, we can assume that the secondary screen is located on the right of the primary screen. Also, the resolution of the secondary screen is known.
Javascript is used, but VBScript would be also possible.
So far the prototype is working quite well
the popup is opened with window.open with left=screen.availWidth+1 -> will be opened in the secondary screen OK
the fullscreen mode is activated with Wscript.Shell sendKeys({F11}) trick. This has some random issues. Timing etc will make it fail sometimes.
There are couple of IE-specific problems that make the implementation much more difficult
screen.availWidth returns always the primary screen resolution. E.g. Firefox returns the right size for popups located in secondary screen. Otherwise I could mimic the fullscreen mode by positioning the popup to fill the secondary screen completely.
window.open() with "fullscreen=1" works too but it ALWAYS opens the popup in the primary screen. This happens even if I use timers to make it target to secondary screen. Also a temporary pop-up located in secondary screen does not help. Looks like the fs=1 will always open the window in the screen where the click originated.
And for clarity, this will be implemented for an intranet application and has valid and well justified reasons. There is no point to suggest to try another web browser.
Any ideas that has been proven to work are welcome!
If a user opens page in new a tab in the background, Css animations are played before he/she switches to the page. Is there any way to show css-animation after user selects the tab ?
You might try using Page Visibility API - http://www.html5rocks.com/en/tutorials/pagevisibility/intro/
might not be supported in older browsers, though
I have a feeling this isn't possible with pure CSS, since CSS is just in charge of displaying the webpage. I think it could be possible with Javascript using onblur and onfocus events. Take a look at http://www.thefutureoftheweb.com/blog/detect-browser-window-focus which has the information and a demo (that does work in Chrome).
Your milage may vary since I could see some security issues with knowing if a user is actively viewing a page or not. I haven't tested this in all browsers
I made a html5 video gallery that is going to be used as a kiosk. I now need it to be viewed in complete full screen mode with no tool bars, similar to when a flash site is in full screen. Is there a way to do this with javascript or jQuery? I was also thinking of calling it from a iframe inside a full screen flash site but dont know if this is possible. Any suggestions will help.
Thanks in advance.
At this time no there is not without having the user press f11. But there is an API in the works that is supposed to make this happen. https://wiki.mozilla.org/index.php?title=Gecko:FullScreenAPI
Edit (Other options):
If you are wanting to work in kiosk mode then possibly John Kurlak's comment will help if you want to work in IE. Also, you can use add-ons such as https://addons.mozilla.org/en-US/firefox/addon/r-kiosk/?src=search. This way you can turn the browser into a kiosk and not worry about users getting back out.
I do not believe a website can force a page to go fullscreen. You can however have the browser start fullscreened and as long as you do not open a separate window it will remain fullscreened.
Could you not create it in a new window using window.open(), passing in fullscreen=true?
How can I change the web browser window state to Fullscreen in javascript(Like when user press F11)? I know how can I specify Window State of new Window that has been opened by Window.Open Method but I want to change the sate of current Window.
You can't and you shouldn't do this.
You shouldn't do this, because it is a annoying user experience. So let the user decide and maybe ask him to press the button for fullscreen mode, but never force him.
You can't because the browser vendors disabled this feature for the reasons of my last point.
Minimal workarround would be to set the window size of the new window to something close to the screen resolution, but this could be tricky if the user has a dual screen.
You can't.
Just ask for the user to press to press F11 and then detect if the user pressed it by checking the key code 122 (eg: keyup event) and comparing the size of the window with the size of the screen (screen.width/height and window.innerWidth/Height).
It's not perfect, specially for users with multiple screens.
You can open a window without toolbars with JS:
window.open("http://www.stackoverflow.com","mywindow","menubar=0,resizable=1,toolbar=0,status=0,width=5000,height=5000");
It will probably be blocked by popup blockers, but that is the most you can do.
So far I know, it is only possible with security privileges, like in an intranet.
For example:
The InternetExplorer.Application ActiveX objects have a "fullScreen" method.
In Firefox 3+, if you have Chrome-privileges you can use "window.fullScreen = true;"
but without those privileges this property is read-only ( https://developer.mozilla.org/en/DOM:window.fullScreen ).
Easy.
<strong>Please view in fullscreen (F11 on most browsers).</strong>
Here's why
No, there's no cheat to remove control of a browser from the user.
I have a htm page that I need to update so that when it is opening it will open at fullscreen. What is the code that I need to place within this page to do so?
Most browsers don't support opening windows in fullscreen. I suggest you only use the document size you are given.
This is not possible.
Don't do this. Firefox doesn't implement this because people just don't like it. You should assume users have their browser the size they want for a reason.
You can't (and shouldn't) force fullscreen, but you can (though probably shouldn't) use Javascript to maximize the window size:
window.outerWidth = screen.availWidth;
window.outerHeight = screen.availHeight;
But as previous people have stated, resizing a user's window is likely going to annoy him.
If fullscreen is really important for your application, you might consider giving the user instructions to switch to this mode manually. You COULD use Javascript to customize these instructions to a users' browser/OS.