Click here to Skip to main content
12,633,990 members (24,353 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: ASP.NET Javascript
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.
<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 16-Jan-13 3:01am
sajithnet1.2K
Updated 16-Jan-13 3:08am
v3

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.161208.2 | Last Updated 16 Jan 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100