Skip to content

Instantly share code, notes, and snippets.

@erotte
Created April 11, 2017 18:16
Show Gist options
  • Save erotte/d5e2f30cada8b8725f40c0251bfcd358 to your computer and use it in GitHub Desktop.
Save erotte/d5e2f30cada8b8725f40c0251bfcd358 to your computer and use it in GitHub Desktop.
check for blocked Popups
var popup = window.open(location.href,'testPopup',"height=1, width=1",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.");
} else {
//Popup Blocker Is Disabled
popup.close();
}
}, 25);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment