Bypassing Browser popup blocking when automatic session timeout occurs

不羁的心 提交于 2019-12-24 07:44:17

问题


Please help regarding the following issue.

I have enabled the "Block popup" option in browser. We are doing a session validation using a background ajax call to check the session is active or not. If the session is not active for a desired interval a popup window will come for notification.

Now comming to the problem . since the session notification popup is comming automatically without any client interaction, This popup is blocked by the browser. But if a client clicks anyother popup window in the form that popup window will not be blocked by the browser.

I want the session notification popup window also not to be blocked by the browser even if the browser "Block popup" option is enabled.


回答1:


A popup blocker is used to block popups. If there was a way around it, it would be completely useless.

You can either:

  1. Add an exception for your domain in your popup blocker's settings
  2. Not use a popup for your notification but rather display it on the page itself through javascript



回答2:


If the browser has blocked use of pop-ups in JavaScript, it has blocked them. There is no way you can force the browser to let them through.

You can always try creating a pop-up like element on your page, it won't force the user to deal with it first (except on your page) but will still 'look' correct.



来源:https://stackoverflow.com/questions/2551534/bypassing-browser-popup-blocking-when-automatic-session-timeout-occurs

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