Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/417.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript window.open在不同屏幕上的不同x位置打开浏览器窗口_Javascript_Macos_Google Chrome_Macos Mojave - Fatal编程技术网

Javascript window.open在不同屏幕上的不同x位置打开浏览器窗口

Javascript window.open在不同屏幕上的不同x位置打开浏览器窗口,javascript,macos,google-chrome,macos-mojave,Javascript,Macos,Google Chrome,Macos Mojave,下面是一个非常简单的脚本: <html> <head> <script> function doit() { var features = "top=100,left=0, height=300, width=550"; console.log(features); window.open('', 'test', features); } </script> </head> <body>

下面是一个非常简单的脚本:

<html>

<head>
<script>

function doit() {
    var features = "top=100,left=0, height=300, width=550";
    console.log(features);
    window.open('', 'test', features);
}
</script>
</head>
<body>
    <div>Hello</div>
    <button onClick="doit()">Test</button>
</body>
</html>

函数doit(){
var features=“顶部=100,左侧=0,高度=300,宽度=550”;
console.log(特性);
窗口打开(“测试”功能);
}
你好
试验
如果我在我的主屏幕上用chrome加载页面并点击按钮,其行为正是我所期望的:

在我的外部监视器上,它变成

新窗口在屏幕最左侧打开

为什么??我怎样才能保证同样的行为

Chrome版本:70.0.3538.110