Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ,

How to check whether popup is blocked or not in ASP.NET for chrome. This works fine for all browsers except chrome.

I searched lot of Query but no result can some one help.
C#
<script language="javascript">
        function detectPopupBlocker() {
            debugger;
                var candidateWin;
                var savedTime = false;
                var valEmailID;
                var sort;
                var direction;
                var popupWin;
                var winWidth = screen.availWidth - 6;   // account for scrollbar
                var winHeight = screen.availHeight - 49;
                candidateWin = window.open('', 'candidateWin', 'width=' + winWidth + ',height=' + winHeight + ',top=0,left=0,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no,dependent=yes');

                if (!candidateWin || candidateWin.closed || typeof candidateWin.closed == 'undefined') {
                    alert('Popup blocked')
                }
                if (candidateWin) candidateWin.close();
         
                 }

    </script>
Posted
Updated 16-Jan-13 2:08am
v3

1 solution

 
Share this answer
 
Comments
sajithnet 16-Jan-13 8:08am    
Thanks patro,
i followed this link but still no result in the case of chrome.
can u share the working sample

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900