Greetings from the future!
In 2023, we can check with
window.screen.isExtended;
whether there is a second monitor.
Then we can use
window.getScreenDetails();
to get the amount of screens, their display details (of which there are many) and their 'left' coordinates. This requires the user to grant permission, though.
With this, you can open a window on a specific screen.
For example:
// If you run this on your left screen (0),
// the window will open on your right screen
async function openWindow(){
// Get screen info
const details = await getScreenDetails();
const secondScreen = details.screens[1];
const {left} = secondScreen;
// Open window
const winProps = `left=${left},top=100,width=640,height=480`;
const win = window.open(
"https://www.google.com/",
"My second screen window",
winProps
);
}
openWindow();
Read more at https://developer.chrome.com/articles/multi-screen-window-placement/#the-window-management-permission