Popup Blocker Detection 2

By Jeff Johnson on Dec 20, 2006


This is a simple, cross-browser method for testing for pop-up blockers. Most scripts test the return value of window.open and conclude that there is a blocker installed if the returned value resolves to false in a boolean statement. However, these scripts fail with browsers such as Opera (as of v9) that return a window object but disable it. This script properly handles this, as well as a null or undefined return type.


  • Created by: Jeff Johnson
  • Posted: December 20, 2006

Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: detectPopupBlocker.js


Paste this code into the HEAD section of your HTML document.