How to Detect whether Pop Up Blocker is active or inactive using java script
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/668286/detect-blocked-popup-in-chrome">Detect blocked popup in Chrome</a>  </p>
</blockquote>



<p>I need to detect whether pop up blocker is active or inactive in a browser using java script.
below is my code what i have tried...</p>

<pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head runat="server"&gt;
&lt;title&gt;&lt;/title&gt;
&lt;script type="text/javascript" language="javascript"&gt;
    window.onload = function() {
        var PopupWarning = {
            init: function() {
                var popups_are_disabled = this.popups_are_disabled();
                if (popups_are_disabled == true) {
                    this.redirect_to_instruction_page();
                } else {
                }
            },
            redirect_to_instruction_page: function() {
                window.location.href = 'a.aspx';
            },
            redirect_to_action_page: function() {
            },
            popups_are_disabled: function() {
                var popup = window.open("http://www.google.com", "popup_tester", "width=1,height=1,left=0,top=0");
                if (!popup || popup.closed || typeof popup == 'undefined' || typeof popup.closed == 'undefined') {
                    return true;
                }
                window.focus();
                popup.blur();
                if (navigator &amp;&amp; (navigator.userAgent.toLowerCase()).indexOf("chrome") &gt; -1) {
                    var on_load_test = function() { PopupWarning.test_chrome_popups(popup); };
                    var timer = setTimeout(on_load_test, 5);
                    return;
                }
                popup.close();
                return false;
            },
            test_chrome_popups: function(popup) {
                if (popup &amp;&amp; popup.chrome_popups_permitted &amp;&amp; popup.chrome_popups_permitted() == true) {
                    popup.close();
                    return true;
                }
                this.redirect_to_instruction_page();
            }
        };
        PopupWarning.init();
    }
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form id="form1" runat="server"&gt;
&lt;div&gt;
    &lt;asp:Label ID="lblText" runat="server" Text="Sample Text"&gt;&lt;/asp:Label&gt;
&lt;/div&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>I can able to detect pop up blocker details in chrome and firefox. But i can't able to detect in IE 8,IE 9,safari and opera.Please tell me did i made any mistake in my code or is there any alteration needed in my code.
Thanks  </p>
