开发者

Detect blocked pop-up in Chrome

开发者 https://www.devze.com 2022-12-26 09:38 出处:网络
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...

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, Detect blocked popup i开发者_StackOverflown Chrome, does not work.


popup.innerHeight no longer works. Use outerHeight, if greater than zero then it was not blocked.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消