firefox浏览器不能使用window.close的解决方案

     javascript中window.close()函数用来关闭窗体,而且IE、google、firefox浏览均支持,但由于firefox浏览器dom.allow_scripts_to_close_windows参数默认值为false,故close不启作用。

    首先在firefox地址栏中输入about:config然后找到dom.allow_scripts_to_close_windows参数设置为true即可,如下图所示:

附 IE、google、firefox通用关闭窗口方法

 function closeWindow() {
           var browserName = navigator.appName;
           if (browserName == "Netscape") {
               window.open('', '_self', '');
               window.close();
           }
           else {
               if (browserName == "Microsoft Internet Explorer") {
                   window.open('', '_parent', '');
                   window.close();
               }
           }
       }
原文地址:https://www.cnblogs.com/easypass/p/3849605.html