How to open IE popup to secondary screen, in FULLSCREEN mode - javascript

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!

Related

Open multiple windows on chrome start

I work in a situation where the computer I use is inconsistent, and I often have never logged onto the computer I'm working on before. As such, I use chrome and launch most of the things I need using the "on startup" option.
My issue is that I have a page that I would like to open in a separate window. I've done some finagling with a javascript bookmarklet that does something similar to what I want, but it isn't perfect.
javascript:window.open("http://google.com","_blank","foobar"); javascript:window.close();
This will open a new window at google.com as expected, however It has a few flaws:
The window is not fullscreen. It will always open at a smaller window size, and is horribly inconsistent on where it will show up.
It isn't a standard window, I can't type in the address bar, add tabs, see my bookmarks bar, or use javascript.
I honestly don't know what the second and third parameters in window.open do, the window will open in a tab instead of a window if I don't have them, but it doesn't care what is there.
I have attempted passing javascript commands through the window.open command, but the window refuses to do any of them.
I understand that this is the type of thing that shouldn't be decided by a webpage, and should be left to a user. But I am the user...
I believe that most of the parameters you mentioned (fullscreen window, window size, other window features) are specified in the third argument of window.open(). For example:
window.open("http://google.com","_blank","fullscreen=yes;menubar=yes;titlebar=yes")
would open http://google.com in a new window (_blank) in fullscreen view (fullscreen=yes;) and render the menubar and titlebar (menubar=yes;titlebar=yes). A list of standard values is provided at w3schools.com and developer.mozilla.org

Change Window State to Fullscreen

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.

How do I open a window on a different screen?

I have an IE7 app that needs to open a popup window onto a second screen. I'm fudging this at the moment by extending the desktop and explicitly opening the window at an offset that makes it appear over on the other one. However this seems like a hack and I'd like to be able to explicitly set the window screen when I call window.open(). Is there any way to do this?
I'm pretty sure this isn't possible. I did some testing and the pop-up windows seemed to be restricted to the monitor "with focus".
Demo: jsfiddle.net/Marcel/25W29

Javascript for full screen

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.

Removing Firefox Star Icon and Bookmark Icon

I am building an application which has requirements stating that all browser features must be disabled. (It's a test taking application and they are worried about security/cheating.)
I popup a new window so that I can make it fullscreen, disable the menu bar, tool bar etc. However Firefox still has two icons remaining that I can't figure out how to disable. The 'Page' icon and the 'Bookmark' star icon are still on even when I call window.open with location=no. Here is the window.open command:
window.open("filename", "test", "fullscreen=yes,status=no,toolbar=no,location=no,menu=no,directories=no,scrollbars=yes");
Is there anything I can do about this?
From the MDC documentation for window.open():
Mozilla and Firefox users can force new windows to always render the location bar by setting dom.disable_window_open_feature.location to true in about:config or in their user.js file
In Firefox 3, dom.disable_window_open_feature.location now defaults to true, forcing the presence of the Location Bar much like in IE7.
This was done to help thwart phishing exploits. You're better off (your users are better off) leaving it enabled, even if you have control over the machines on which the browser is running.
You should really be designing your application such that knowing or bookmarking the URL won't help would-be cheaters. For instance: don't accept an answer to a question when an answer has been previously submitted.
If you don't have control of the computer the user is taking the test on, there's nothing you can do (and opening a full screen window won't prevent cheating for savvy users, either).
If you do have control over the computer or can instruct the user to install an application, you'd be best suited by building an actual application with embedded WebKit or Gecko.

Categories

Resources