Open popup from Chrome Extension on Dual monitor

时间:2016-07-11 20:36:54

标签: javascript google-chrome-extension

I have a Google Chrome Extension which uses a background process to pop a browser window.

This works OK except for when I have Dual monitors.

Chrome is running on monitor 2. The popup however always occurs on monitor 1 (I want it to open on the monitor where chrome is running).

not matter what I do with window.open parameters it still opens on monitor 1.

You can see in my code I've tried forcing the left to 2000 as an experiment (monitor 1 is 1366 wide). It goes to the right-corner of monitor 1 no matter how high this setting is.

var ilinkWindow = window.open("popup.html", "extension_popup", "width=300,height=500,status=no,scrollbars=yes,resizable=no,top=0,left=2000");
ilinkWindow.focus();

1 个答案:

答案 0 :(得分:0)

as @wOxxOm says use chrome.windows.create.

That worked for me.