在 Firefox 和 Firefox 中打开没有地址栏的新弹出窗口IE

发布于 2024-09-03 07:40:31 字数 286 浏览 2 评论 0 原文

希望有人可以帮忙。只是无法在没有地址栏的 Firefox 中打开新窗口。 以下代码一起正常工作

window.open('/pageaddress.html', 'winname', 
  directories=0,titlebar=0,toolbar=0,location=0,status=0,     
    menubar=0,scrollbars=no,resizable=no,
      width=400,height=350);

IE可以与我需要为所有浏览器制作的

hope someone can help. just cannot get a new window to open in Firefox without address bars. IE works fine with below code

window.open('/pageaddress.html', 'winname', 
  directories=0,titlebar=0,toolbar=0,location=0,status=0,     
    menubar=0,scrollbars=no,resizable=no,
      width=400,height=350);

I need to make for all browser

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

你另情深 2024-09-10 07:40:31

Firefox 3.0 及更高版本默认禁用设置 location。默认情况下,ressizedstatus 也处于禁用状态。您可以通过在地址栏中输入“about:config”并按“dom”进行过滤来验证这一点。感兴趣的项目有:

  • dom.disable_window_open_feature.location
  • dom.disable_window_open_feature.ressized
  • dom.disable_window_open_feature.status

您可以在 Mozilla 开发者网站。不过,这基本上意味着您将无法做您想做的事。

您可能想做的一件事(尽管它不能解决您的问题)是在窗口功能参数周围加上引号,如下所示:

window.open('/pageaddress.html','winname','directories=no,titlebar=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=350');

Firefox 3.0 and higher have disabled setting location by default. resizable and status are also disabled by default. You can verify this by typing `about:config' in your address bar and filtering by "dom". The items of interest are:

  • dom.disable_window_open_feature.location
  • dom.disable_window_open_feature.resizable
  • dom.disable_window_open_feature.status

You can get further information at the Mozilla Developer site. What this basically means, though, is that you won't be able to do what you want to do.

One thing you might want to do (though it won't solve your problem), is put quotes around your window feature parameters, like so:

window.open('/pageaddress.html','winname','directories=no,titlebar=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=350');
无法回应 2024-09-10 07:40:31

我同意我们不能在现代浏览器中隐藏地址栏,但我们可以隐藏地址栏中的URL(例如显示URL about:blank)。以下是我的解决方案:

var iframe = '<html><head><style>body, html {width: 100%; height: 100%; margin: 0; padding: 0}</style></head><body><iframe src="https://www.w3schools.com" style="height:calc(100% - 4px);width:calc(100% - 4px)"></iframe></body></html>';

var win = window.open("","","width=600,height=480,toolbar=no,menubar=no,resizable=yes");
win.document.write(iframe);

I agree we can not hide address bar in modern browsers, but we can hide the URL in address bar (e.g show URL about:blank). The following is my work around solution:

var iframe = '<html><head><style>body, html {width: 100%; height: 100%; margin: 0; padding: 0}</style></head><body><iframe src="https://www.w3schools.com" style="height:calc(100% - 4px);width:calc(100% - 4px)"></iframe></body></html>';

var win = window.open("","","width=600,height=480,toolbar=no,menubar=no,resizable=yes");
win.document.write(iframe);
美人骨 2024-09-10 07:40:31

查看有关 window.open 的 Mozilla 文档
窗口功能(“directory=...,...,height=350”)等参数应该是一个字符串:

window.open('/pageaddress.html','winname',"directories=0,titlebar=0,toolbar=0,location=0,status=0,menubar=0,scrollbars=no,resizable=no,width=400,height=350");

尝试一下是否在您的浏览器中有效。请注意,某些功能可能会被用户首选项覆盖,例如“位置”(请参阅​​文档)。

Check the mozilla documentation on window.open.
The window features ("directory=...,...,height=350") etc. arguments should be a string:

window.open('/pageaddress.html','winname',"directories=0,titlebar=0,toolbar=0,location=0,status=0,menubar=0,scrollbars=no,resizable=no,width=400,height=350");

Try if that works in your browsers. Note that some of the features might be overridden by user preferences, such as "location" (see doc.)

喜你已久 2024-09-10 07:40:31

解决方法 - 打开模式弹出窗口并将外部 URL 作为 iframe 嵌入。

Workaround - Open a modal popup window and embed the external URL as an iframe.

倾其所爱 2024-09-10 07:40:31

在 Internet Explorer 中,如果新 url 与当前 url 来自同一域,则打开的窗口将不显示地址栏。否则,会导致出现地址栏。一种解决方法是打开来自同一域的页面,然后从该页面重定向。

In internet explorer, if the new url is from the same domain as the current url, the window will be open without an address bar. Otherwise, it will cause an address bar to appear. One workaround is to open a page from the same domain and then redirect from that page.

梦里梦着梦中梦 2024-09-10 07:40:31

检查这个是否有效,对我来说效果很好

var windowObjectReference;
var strWindowFeatures = "menubar=no,location=no,resizable=no,scrollbars=no,status=yes,width=400,height=350";

function openRequestedPopup() {
  windowObjectReference = window.open("http://www.flyingedge.in/", "CNN_WindowName", strWindowFeatures);
}

openRequestedPopup();

check this if it works it works fine for me

var windowObjectReference;
var strWindowFeatures = "menubar=no,location=no,resizable=no,scrollbars=no,status=yes,width=400,height=350";

function openRequestedPopup() {
  windowObjectReference = window.open("http://www.flyingedge.in/", "CNN_WindowName", strWindowFeatures);
}

openRequestedPopup();

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文