views:

368

answers:

2

Ok so I am using Chromium for Ubuntu 9.10 and cannot get this working using the normal means of detecting a pop-up blocker which are...

var popup = window.open(...);
var blocked;
if(!popup) {
    blocked = true;
} else {
    blocked = false;
}

Also, the accepted solution in this SO post, http://stackoverflow.com/questions/668286/detect-blocked-popup-in-chrome, does not work.

+1  A: 

If it's a page on the same domain, check popup.innerHeight. If it's 0, the popup was most likely blocked.

Eli Grey
console.log(popup.outerHeight) reveals 275, which is actually the height attribute I am passing to window.open
Flash84x
Flash84x: You might want to try `innerHeight` too.
Eli Grey
innerHeight is 0 when the popup is blocked and when the popup is visible, so no dice :-\
Flash84x
Also when it's visible? I find that hard to believe and I am unable to reproduce it being zero when a previously-blocked (and then manually allowed) popup is visible.
Eli Grey
A: 

I have tried getting the innerHeight too. When the browser is set to disallow popups, the result is zero as expected. However, when I allow popups, the result remains at zero when I can see the popup!

Has anyone found a solution to this?

Peter Lane
I noticed the same thing Peter, I still have not found a solution.
Flash84x