Window.open打开一个选项卡,而不是firefox和safari中的窗口

Window.open opening a tab instead of window in firefox and safari

本文关键字:firefox safari 窗口 open 选项 一个 Window      更新时间:2023-09-26

我有一个简单的HTML布局:

<html>
<head>
  <script>
  function test() {
window.open('http://google.com','','menubar=no,toolbar=no,status=no,scrollbars=yes,resizable=no,width=545,height=353');
  }
  </script>
</head>
<body>
  <button onclick="test();">Test</button>
</body>
</html>

单击该按钮将打开一个新窗口,其中包含我指定的规格。然而,它在firefox和safari中打开了一个新的选项卡。它的镀铬效果很好。尚未测试其他浏览器。上面的代码有问题吗?

弄清楚了。这是因为我在全屏模式下使用Firefox和Safari,所以打开新窗口会打开一个新的选项卡,而不是退出全屏模式:)

感谢