Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/371.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Firefox中使用javascript关闭窗口_Javascript - Fatal编程技术网

在Firefox中使用javascript关闭窗口

在Firefox中使用javascript关闭窗口,javascript,Javascript,我需要关闭一个链接点击窗口。我可以在IE中通过window.close完成,但在Firefox中无法完成。在谷歌搜索时,我发现我必须设置 dom.allow_scripts_to_close_windows属性设置为true也会在firefox中生效 有人可以指导我,如何以及在哪里设置此属性为真吗?我对此一无所知。您只能使用javascript关闭firefox中的子窗口。是否要关闭父窗口?在URL上,您可以键入: about:config并按enter键 在第二个窗口中接受条款 您将在搜索do

我需要关闭一个链接点击窗口。我可以在IE中通过window.close完成,但在Firefox中无法完成。在谷歌搜索时,我发现我必须设置

dom.allow_scripts_to_close_windows属性设置为true也会在firefox中生效


有人可以指导我,如何以及在哪里设置此属性为真吗?我对此一无所知。

您只能使用javascript关闭firefox中的子窗口。是否要关闭父窗口?

在URL上,您可以键入:

about:config并按enter键

在第二个窗口中接受条款

您将在搜索dom.allow中获得配置项列表,并通过双击值列使其成为现实


这看起来像是来自about:config的firefox配置参数。你不能强迫用户设置它…window.open,“_self”//如果navigator.userAgent.indexOfFirefox=-1{netscape.security.privilegmanager.enablePrivilege'UniversalBrowserWrite';}window.close;阅读此文档并尝试此示例我知道这些内容,但我面临的问题是,我试图关闭的窗口没有通过javascript打开。从一些文档中我了解到,在firefox中,我们无法关闭未通过javascript打开的窗口