是使用firefox无法进行window.open(“",...)吗? [英] is window.open("", ... impossible with firefox?

查看:682
本文介绍了是使用firefox无法进行window.open(“",...)吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在firefox中,我已经使用file://协议打开了一个本地存储的文件 (文件:///c:/temp/foo.html)

In firefox I have opened a locally stored file with the file:// protocol (file:///c:/temp/foo.html)

foo.html包含Java脚本(除其他外)被认为是新的. 窗口没有 URL:

foo.html contains Java Script which (among others) is supposed a new window without URL:

var new_window = window.open("","", "height=100,left=50,width=200");

到达此行时,Firefox显示此"Firefox阻止该站点打开弹出窗口".我不明白为什么Firefox会发出此警告,显然,文件(foo.html)在我的控制下(因为它存储在本地,并且我已经使用file://协议打开了它,并且,此外,要打开的窗口不会指向任何可能包含任何敏感数据的文件,因为open方法中的url参数设置为".

When this line is reached, Firefox displays this "Firefox prevented this site from opening a pop-up window". I don't understand why Firefox gives this warning, obviously, the file (foo.html) is under my control (since it's stored locally and I have opened it with the file:// protocol, and, additionally, the window to be opened doesn't point to any file that could contain any sensitive data, as the url parameter in the open method is set to "".

但是除此之外,看来我什至无法强制或允许Firefox打开窗口.黄色的"Firefox prev ...."栏上有一个选项"按钮,应该可以创建例外,但我不能.

But besides all this, it seems I can't even force or allow firefox to open the window anyway. There's this "options" button on the yellow "Firefox prev...." bar which supposedly should allow to create exceptions, yet I can't.

因此,问题基本上可以归结为:如何允许本地html文件在Firefox中使用Javascript打开一个空窗口.

So, the question basically boils down to: how can I allow a local html file to open an empty window with Javascript within Firefox.

谢谢/勒内(Rene)

Thanks / Rene

推荐答案

这是Firefox的安全预防措施,请参见以下链接:

This is a Firefox security precaution, see this link:

http://kb.mozillazine.org/Links_to_local_pages_don't_work

但是,看起来该扩展名使您可以覆盖它:

However, it looks like this extension will allow you to override it:

https://addons.mozilla.org/zh-CN/firefox /addon/281

这篇关于是使用firefox无法进行window.open(“",...)吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆