Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
175
rated 0 times [  177] [ 2]  / answers: 1 / hits: 31610  / 11 Years ago, tue, may 14, 2013, 12:00:00

I have searched many issue in stack overflow and might be duplicate here Detect Popup



But not helped for me while testing in Chrome (tested v26.0.1410.64)

Following Approach Worked in IE and Firefox but not in Chrome



var popup = window.open(winPath,winName,winFeature,true);
if (!popup || popup.closed || typeof popup.closed=='undefined'){
//Worked For IE and Firefox
alert(Popup Blocker is enabled! Please add this site to your exception list.);
window.location.href = 'warning.html';
} else {
//Popup Allowed
window.open('','_self');
window.close();
}


Any better solution that works for Chrome also?


More From » jquery

 Answers
7

Finally, it success by combining different answer from Stackoverflow's member

This code worked for me & tested in IE, Chrome & Firefox



var popup = window.open(winPath,winName,winFeature,true);
setTimeout( function() {
if(!popup || popup.outerHeight === 0) {
//First Checking Condition Works For IE & Firefox
//Second Checking Condition Works For Chrome
alert(Popup Blocker is enabled! Please add this site to your exception list.);
window.location.href = 'warning.html';
} else {
//Popup Blocker Is Disabled
window.open('','_self');
window.close();
}
}, 25);

[#78248] Sunday, May 12, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
marcos

Total Points: 331
Total Questions: 106
Total Answers: 104

Location: Gabon
Member since Sat, Jul 25, 2020
4 Years ago
;