我想隐藏新弹出窗口的地址栏。我用谷歌搜索了很多,所有的结果都是这样的。
This is no longer possible in modern browsers due to security restrictions.
Official(-ish) Sources:
Firefox
In Firefox 3, dom.disable_window_open_feature.location now defaults to true, forcing the presence of the Location Bar much like in IE7. See bug 337344 for more information.
Internet Explorer 7 and later
In Internet Explorer 6, location specifies whether to display the Address Bar.
(Implying the behaviour ends with IE6)
Chrome/Chromium
Those toolbar hiding parameters are ignored in Chrome. You will also notice that modern browsers are moving towards not hiding it as security / anti phishing measures. Also see https://bugzilla.mozilla.org/show_bug.cgi?id=337344
这意味着window.open
的位置选项不再起作用。
地址栏真的无法隐藏吗?有什么好的解决办法吗?我们的项目确实需要隐藏地址栏。请求参数是发送 session id,我的老板想隐藏它。它正在调用 Get RESTAPI,因此不能选择使用 POST 隐藏参数。
有什么好主意吗?
最佳答案
您几乎自己回答说,出于安全原因这是不可能的。但您仍然可以使用 iframe 和 ajax。
想象一个场景,当带有虚假地址栏的弹出窗口打开时,您访问一些带有虚假互联网交易对话框的网站,并且有人窃取了您的真实资金。很奇怪,但 7 年前这是可能的。
关于javascript - 在现代浏览器中隐藏地址栏是不可能的吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19968432/