检测用户是否选择不在 IE 中显示不安全内容
我有一个通过 https 提供的页面,在某些情况下可以显示通过 http 从机架空间拉取的图像。
在 IE 中,这会触发警告,询问用户是否要显示不安全的项目。
如果用户选择显示它们,那么一切都很好。但是,如果他们选择不显示它们,他们会发现页面看起来很损坏。
我正在尝试开发一种解决方案,如果用户选择隐藏它们,我会检测到这一点并弹出一个对话框,解释为什么页面看起来损坏以及他们需要做什么才能使其正常工作。
我尝试添加图像,通过 HTTP 加载并使用 onerror 事件调用对话框,但当图像被阻止时它不会触发。
我知道这首先不是一个理想的情况,这是一个最终会解决的问题,但与此同时,我知道如何检测用户选择了哪个选项吗?
I have a page served over https that in some instances can display images pulled from rackspace over http.
In IE this triggers a warning asking if the user would like to display the insecure items.
If the user chooses to display them, all is good. However if they choose not to show them they will find the page looks broken.
I was trying to work on a solution where, if the user chooses to hide them, I detect that and pop up a dialog explaining why the page looks broken and what they need to do to make it work.
I tried adding an image, loaded over HTTP with an onerror event to call the dialog but it doesn't fire when the image is blocked.
I understand that this is not an ideal situation in the first place and it's a problem that will eventually be solved but, in the mean time, any idea how I can detect which option the user has chosen?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我完全不确定这是否有效。如果您安装了 Apache,也许您可以通过本地 HTTPS 代理 HTTP URL。有点像挖隧道。
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html
应改为:
I am not at all sure if this will work. If you have Apache installed, may be you can proxy the HTTP URL through a local HTTPS one. Sort of like tunnelling it.
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html
This should be changed to: