Is there a good way to determine if a person has a popup blocker enabled? I need to maintain a web application that unfortunately has tons of popups throughout it and I need to check if the user has popup blockers enabled.
The only way I've found to do this is to open a window from javascript, check to see if it's open to determine if a blocker is enabled and then close it right away.
This is slightly annoying since users who do not have it enabled see a small flash on the screen as the window opens and closes right away.
Are there any other non-obtrusive methods for accomplishing this?
Read Detect a popup blocker using Javascript:
Basically you check if the 'window.open' method returns a handle to a newly-opened window.
Looks like this:
var mine = window.open('','','width=1,height=1,left=0,top=0,scrollbars=no');
if(mine)
var popUpsBlocked = false
else
var popUpsBlocked = true
mine.close()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With