简体   繁体   中英

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

I have a simple HTML layout:

<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>

Clicking the button is supposed to open a new window with the specs I specified. However, it's opening a new tab instead in firefox and safari. It works well in chrome. Haven't tested other browsers. Is there something wrong with the above code?

Figured out. It was because I'm using Firefox and Safari in full screen mode so opening new windows would open a new tab instead to not get out of the full screen mode :)

Thanks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM