Javascript popup on two monitors disabled

I am trying to open a javascript popup based on where the current window is located. I have a dual monitor setup, and it works in any other browser, but chrome. For some reason, when chrome is on my second monitor, a pop-up window to the right.

var winX = (document.all) ? window.screenLeft : window.screenX;
var winY = (document.all) ? window.screenTop : window.screenY;

var newWindowWidth = 650;
var newWindowHeight = 700;

var currentWindowWidth = $(window).width();
var currentWindowHeight = $(window).height();

var newWindowX = (winX + (currentWindowWidth / 2)) - (newWindowWidth / 2);
var newWindowY = (winY + (currentWindowHeight / 2)) - (newWindowHeight / 2);

window.open("", "configurationWindow", "scrollbars=1,resizable=yes,width=" + newWindowWidth + ",height=" + newWindowHeight + ",top=" + newWindowY + ",left=" + newWindowX);
+3
source share
1 answer

This is a known bug in Chrome, id # 73353 . If you have a Google account, you can run it to track its status.

+2
source

Source: https://habr.com/ru/post/1795542/


All Articles