Reputation: 56467
When I use JavaScript function
var w = window.open('about:blank');
under FireFox the popup is blocked and I get the option to unblock it. Even if I do this the popup does not appear (I believe the JavaScript needs to be fired one more time).
But I need to be sure that the popup fires even when the code runs for the first time.
So what I want is to check whether FireFox allows popups. There are two possibilities:
This should be done in such a way that if it does not allow then show appropriate message and wait (setTimeout
?) until the access is granted (and open popup afterwards).
Before doing this window.open
operation check if FireFox allows popups. If it does not, then show appropriate message (and do not allow the user to go deeper inside app without granting access) but if it does allow then do not open the popup (user does not need to see that he can fire popups). All of this can be done for example when user logs in (all of main popups require the user to be loged in).
So that's the idea. But what about JavaScript? How can I achieve this? Is it even possible?
Upvotes: 0
Views: 3400
Reputation: 117324
When firefox blocks a popup, the reference to w will be null.
So my suggestion:
Other ideas:
Upvotes: 1