How can I detect if a browser is blocking a popup? - JavaScript

How can I detect if a browser is blocking a popup? Occasionally, I've come across a webpage that tries to pop open a new window (for user input, or something important), but the popup blocker prevents this from happening. What methods can the calling window use to make sure the new window launched properly? 9 Answers If you use JavaScript to open the popup, you can use something like this: var newWin = window.open(url); if(!newWin || newWin.closed || typeof newWin.closed=='undefined') { //POPUP BLOCKED } Here's an answer for chrome: detect-blocked-popup-in-chrome @ ajwaka could you kindly clarify if this answer fails for chrome, or is there a reason the other answer is better for chrome? thanks! @ ajwaka at least today this code seems to work on chrome, hence the question. @ Crashalot - You're asking me about something I answered this 6 years ago - I sadly no longer recall the situation and browsers have come a long ways in 6 years. I tried a nu