javascript - 在现代浏览器中隐藏地址栏是不可能的吗?

标签 javascript browser window.open

我想隐藏新弹出窗口的地址栏。我用谷歌搜索了很多,所有的结果都是这样的。

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/

相关文章:

javascript - 使用 plainroute react 多个布局(路由根)

javascript - 浏览器唯一键

c# - 使用 URL WPF 打开浏览器

javascript - 如何自定义浏览器窗口的标题

javascript - 从 react 中的另一个组件访问状态

javascript - 如何将相同的 javascript 函数绑定(bind)到输入更改和按钮单击

php - 有没有一种方法可以记录用户在 MySQL 数据库中提交表单的浏览器

c++ - 备用http端口?

javascript - iframe 中的 Open.window

javascript - window.open(url, target) 不会激活 Firefox 中的选项卡