2

I have a website on my companies intranet which needs to be displayed over 2 monitors. At the moment, the user logs in and is redirected to the first page, with an instruction to click a certain link to open another page in a new window and drag it onto their second monitor.

What we would like is the user to log in, be redirected to the first page as usual, but have the other page automatically open on the other monitor in a maximised browser window.

Normally I would refuse to do this, but this is an internal use only site, and our users are expecting it to happen.

Is there a way of doing this? I am an html guy and anything beyond that, is beyond me.

user3942918
  • 25,539
  • 11
  • 55
  • 67
Ian Williams
  • 45
  • 2
  • 8
  • Possible duplicate of [Make Chrome open on second monitor?](http://stackoverflow.com/questions/27955511/make-chrome-open-on-second-monitor) – C.Liddell Apr 04 '16 at 13:22
  • 1
    Simply not possible here you are not opening new chrome just opening new tab; – itzmukeshy7 Apr 04 '16 at 13:25

3 Answers3

2

Yes you can sort of do this, although it would have to be very adhoc and user centric as you will have to set it up for the explicit scenario. It would also take some tinkering to get your position and size right.

Here's a concept example using the window.open() method. Sorry there's no way you can you do it with just html/css. Pay attention to the left and other attributes set as they're what you'll be tinkering with. See the documentation for more information.

CODEPEN

Example function;

function iLikeToMoveItMoveIt() {
    window.open("http://www.stackoverflow.com", 
                "_blank", 
                "toolbar=yes, scrollbars=yes, resizable=yes, 
                 top=500, left=800, width=1000, height=1000");
}

And an initiation;

<button onclick="iLikeToMoveItMoveIt()">
   HEY LET'S OPEN A WINDOW SOMEWHERE!
</button>

Hope this helps, cheers.

ADDENDUM:

Fire off the function on page load then..

<script>
  window.onload = iLikeToMoveItMoveIt();
</script>
Chris W.
  • 22,835
  • 3
  • 60
  • 94
  • This is great, and I can use it for a somewhat related project, but what I was hoping to do was have the user log in, be redirected to page A as normal, but then have page B automatically open on the second monitor without any other interaction required. We get support calls every day from users who cant see page B as some of our users are plainly stupid and cannot follow the instructions on screen... – Ian Williams Apr 05 '16 at 08:31
  • @IanWilliams see updated answer. Just fire off the function on page load instead of on button click... – Chris W. Apr 05 '16 at 13:21
  • 1
    AFAIS the new popup window cannot be created on a different monitor. At least on Linux. If you give `left` both negative values (second monitor on the left) or higher than actual screen width (second monitor on the right) the viewport remains firmly anchored on the current display (which makes a lot of sense...) – Marco Faustinelli Sep 27 '19 at 07:51
  • Ah yes, I assume much has changed in the years since this was answered when most of us hadn't even adopted windows 10 yet. Same behavior Marco describes above is seen on windows 10 also. So for future readers, this answer is likely void. – Chris W. Sep 27 '19 at 21:51
1

I had a similar task - when opening a listing, display details on other monitor.

I solved it using localStorage. I basically had localhost/sender opened on one monitor, localhost/receiver on the other and when user clicked on something in sender, localStorage changed and a listener in receiver handled it (by sending AJAX requests).

For an extremely simple example, if you enter something in this JSFiddle sender, you should see changes made at realtime in JSFiddle receiver (just make sure to 'Run' them both).

I don't think there is a simpler way, you would need to handle fullscreened windows and different resolutions and whatnot.

Somrlik
  • 680
  • 5
  • 13
1

Confirmed that popping up a new browser window on a second display CANNOT be done anymore.

When I was researching at the beginning. Many JavaScript forums had codes shown to do this and detailed how to detect the second monitor, which dated mostly from 2012 to 2018. So I thought this feature was doable and with so many years passed it would only get easier to implement.

However, when I tried to detect the width and height of a second display it could never find it no matter how I tweaked the codes. I thought JavaScript function names might have changed or it became browser-dependent. So I kept on searching and experimenting but none worked.

Eventually, I tried instead to push the pop-up browser window out of the current display to left and right, without regards of the second display's resolution, then I found out that the pop-up windows always stayed on the left or right edge of the current screen no matter how far off you tried to push it. This well-formed feature gave me a hint that this limitation (not passing the boundaries of the current display) might just be a built-in feature within the browser on Windows platform.

Knowing this fact, further searches in a different direction brought me other users' experiences in more recent years and confirmed that those JavaScript functions detecting a second display would not work anymore on Windows 10 platform at least dating back in 2019 on Windows 10 platform.

Maybe this restriction is now considered a security necessity because a browser is largely dealing with unknown users from the Internet and it should naturally be limited on what it is allowed to detect and access on the computer’s properties. It's now the end of 2022, so I might just conclude that this kind of pop-up on second display implementation is a dead-end.

(I know there are already specialized sign-off devices on the cashier's counter top in large department stores but those are essentially provided by payment system providers, which require purchase and installation of separated software/hardware/devices. This would not be desired as we have already had a web application that is fully handling the entire ordering processes from start to finish. Our sign-off feature is just a new requirement.)

I considered Somrlik's solution using AJAX but it requires a call to check every 5 seconds or so which is quite a work load for a process happens only 5 to 10 time during the whole day of opening hours (not all sales require a signature). Moreover, it also requires a dummy web page opening all the time to stand by on the customer facing display which should be blank most of the time. Therefore, this solution may not apply in my situation.

I wish I were wrong with all this and someone could point me a way to implement this because I do have a need to pop up a separated web page on a second display facing customers for them to sign off an order when a sales person clicked a "Sign Off" button on the ordering page on her sales computer screen.

Jack Ceramic
  • 212
  • 2
  • 6