I need to know when the user clicks on the button that triggers window.open
if there is stable API/way to know beforehand if the user actively has
Use this code to check
var popupBlockerChecker = {check:function(b) {
var a = this;
b ? /chrome/.test(navigator.userAgent.toLowerCase()) ? setTimeout(function() {
a._is_popup_blocked(a, b);
}, 200) : b.onload = function() {
a._is_popup_blocked(a, b);
} : a._displayError();
}, _is_popup_blocked:function(b, a) {
0 == 0 < a.innerHeight && b._displayError();
}, _displayError:function() {
alert("Popup Blocker is enabled! Please add this site to your exception list.");
}};
and the usage will be something like
var popup = window.open("http://www.google.com.au", '_blank');
popupBlockerChecker.check(popup);