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