Is there any way to determine if the popup blocker is enabled in a browser through JavaScript without opening the new tab?
Asked
Active
Viewed 2,899 times
2
-
There's also [this one](http://stackoverflow.com/questions/250216/popup-detection-before-user-logs-in) which does a `window.open` but then **immediately** closes it. – T.J. Crowder Feb 01 '17 at 08:52
-
@T.J.Crowder My apologies. I guess it dupe of this: http://stackoverflow.com/questions/2914/how-can-i-detect-if-a-browser-is-blocking-a-popup. This also address the `window.open` approach that you pointed out – Rajesh Feb 01 '17 at 08:53
-
@Rajesh: It would be (and also the one I linked above), except that all of the real answers there do what the OP said he/she doesn't want to do. – T.J. Crowder Feb 01 '17 at 08:58
1 Answers
1
I don't think you can detect it without using window.open
, so I think the short answer to your question is: No, there isn't.
The accepted answers to this question and this question demonstrate using window.open
(the first then immediately closes the window). However: If the popup is blocked, the user still receives the notification of a blocked popup (at least in Chrome, but probably others as well), which I'm guessing is why you've said you don't want to use window.open
.
So again, I think the answer to your question is: No, you can't do that.

Community
- 1
- 1

T.J. Crowder
- 1,031,962
- 187
- 1,923
- 1,875