问题
To end a user´s browsersession successfully on browser-unload we need to open a new window to call some webservice to reset the user´s session data on the server. With an active popup blocker this will not succeed.
Our solution is querying the popupblocker-status when starting our application, stop further execution when the blocker is turned on, and request the user to turn off popup-blocking, or at least make him/her accept popups from our application/url or not....
I have read a lot on how to determine if a popup is being blocked. All examples are using window.open which actually opens a window if the blocker appears to be off. We would like to avoid this window to appear (and close it right away), just to check if the blocker is turned on.
Do you happen to know if there is an alternative way to get a browser´s popupblocker-status? By reading a browser-property for example?
来源:https://stackoverflow.com/questions/23288624/get-browser-popup-blocker-status-using-javascript