sajith tg

sajith tg

  • NA
  • 7
  • 0

how to check whether popup is blocked or not in chrome

Jan 20 2013 11:12 PM

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 with working sample.


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

Regards,
sajith