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?
The only way to test if your browser is configured to show pop-up windows is to actually try to automatically open a pop-up window; this is why you might have either seen a "Pop-up Blocked" warning near your browser's Address Bar, or you may have seen a pop-up window flash on the screen briefly.
Under Privacy and security, click the Content Settings button. Select Pop-ups and redirects. To disable the pop-up blocker uncheck the Blocked (recommended) box. To enable pop-ups on specific sites, check Blocked (recommended) and click Add next to Allow and enter the URL(s).
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);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With