Get browser popup blocker status using JavaScript

夙愿已清 提交于 2020-01-14 05:51:28

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!