我看到很多问题询问如何使用 window.open 打开选项卡,但我想要相反的。单击链接时,我想要一个功能齐全的新窗口(不要缺少地址栏或任何其他内容),而不是新选项卡。
我一直在使用这个:
window.open('http://example.com', 'blah', 'titlebar=1,toolbar=1,scrollbars=1,location=1,status=1,menubar=1,resizable=1,width=800,height=600,top=10,left=10');
在 FF 中,我得到新窗口作为弹出窗口。在 Chrome(和 IE9)中,它会作为新选项卡打开。
如果我设置 status=0,我会收到弹出窗口,但它不是 chrome 中的普通窗口(但在 IE9 中)。有什么想法吗?
最佳答案
没有办法告诉 JS 或 HTML 操作在新选项卡还是新窗口中打开链接。它完全依赖于浏览器。
被欺骗了 target="_blank" opens a new window in IE9, instead of a new tab
super 用户的 Chrome 设置:https://superuser.com/questions/166479
mozilla 支持上的 Firefox 设置:http://support.mozilla.org/en-US/kb/tab-preferences-and-settings
关于javascript - 当参数功能齐全时,Window.open 创建新选项卡而不是弹出窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15126794/