Skip to content

Instantly share code, notes, and snippets.

@fragje
Forked from brunofrank/gist:2025969
Created March 14, 2012 11:33
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save fragje/2035908 to your computer and use it in GitHub Desktop.
Save fragje/2035908 to your computer and use it in GitHub Desktop.
JavaScript: Popup blocker detector tested on Chrome, Firefox, Safari and IE
var test = window.open(null,"","width=1,height=1");
setTimeout(function(){
if (test && test.innerHeight && test.innerHeight > 0) {
// POPUP BLOCKER DISABLED
test.close();
}
}, 10);
@logakarthi
Copy link

Hi Man,

I tried your code stuff, I'm unable to dismiss the "turn off your popup blocker!" in my web page(in iPhone) while trying to switch over the new tab. Is there any solution to handle such unhandled alerts behavior scenario.

Above your code stuff, it works fine in Android chrome browser(mobile device).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment