IE 11中的弹出窗口阻止程序设置不起作用

时间:2018-06-26 21:39:14

标签: javascript html

我正在使用下面的代码来检查IE 11中的弹出窗口阻止程序设置。但是无论任何设置,“打开弹出式阻止程序”都处于选中状态或关闭状态。 Internet Option => Privacy =>“打开弹出式阻止程序”

window.open(“ /”,“”,“ height = 100,width = 100”);正在打开窗口,所以我的else部分永远不会执行。我已经花了2天的时间,但是还没有找到任何解决方案。看来IE无法正常运作。相同的代码可以在Chrome,Firefox和enter code here野生动物园上正常工作。

<script >
        var myQueryString = document.location.search;
        function detectPopupBlocker() 
        {       
            var myTest = window.open("/", "", "height=100,width=100");
            if (myTest=='false' || myTest == null || typeof(myTest )=='undefined') 
            {                   
                window.location.href = '/ChromePopup.html';             
                myTest.close();                   

            }
            else 
            {
               myTest.close();
            }
        }                  

0 个答案:

没有答案