Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Opening a new browser page on the second monitor

Well, simple situation. Is it possible to detect if a user has a dual monitor setup from a web application? If this is possible, is it possible to open a child browser page on this second monitor, so the new window doesn't overlap the old one?

Reason why I ask: I'm working on a web application and at home I have a dual-monitor system. When I go to the administration part of this site, I want it to open in a new browser, preferably on the other desktop. Of course, I could just click, then drag the new window, but doing this automatically seems more fun. :-)

Don't think JavaScript has the proper functions for this. How about Java itself?

like image 411
Wim ten Brink Avatar asked Aug 18 '09 13:08

Wim ten Brink


People also ask

How do I have 2 windows open on 2 screens?

On the Windows desktop, right-click an empty area and select the Display settings option. Scroll down to the Multiple displays section. Below the Multiple displays option, click the drop-down menu and select Extend these displays.


2 Answers

I don't think you'll be able to directly detect a dual monitor setup, but you can probably make a good guess by looking at their screen resolution, using javascript's screen.width and screen.height. If the ratio of the width to the height is 8:3, its a good chance they have 2 standard 4:3 monitors side by side. You can do a similar calculation for 16:9 or 16:10.

like image 118
maxpower47 Avatar answered Oct 09 '22 15:10

maxpower47


Using maxpower47's suggestion about resolution, the only way to display the page on the other monitor would be to open a popup, and use the options to set the top, right, width and height properties so the window will appear on the second monitor in a decent size.

Here is a link that describes how to do this: http://www.netmechanic.com/news/vol4/javascript_no7.htm

like image 36
Jason Miesionczek Avatar answered Oct 09 '22 17:10

Jason Miesionczek