检测“由于 X-Frame-Options 禁止显示而拒绝显示文档”的方法。错误?
我正在使用“谷歌查看器”来查看一些文档。 唯一的问题是,如果浏览器的 google 登录处于“limbo”状态,则不会显示任何内容,并且“拒绝显示文档,因为 X-Frame-Options 禁止显示”。发生错误并显示在控制台中。
我所说的“limbo”是指已知登录信息但用户必须重新输入密码才能重新验证自己的情况。
有没有一种方法可以检测何时发生此错误,以便我可以显示弹出错误来通知用户?
提前致谢。
I am using 'google viewer' to view some documents.
Only problem is, if the browser has a google-login that is in "limbo" it shows nothing and the "Refused to display document because display forbidden by X-Frame-Options." error occurs and is shown in the console.
What I mean by "limbo" is when a login is known but the user has to re-enter their password to reverify themselves.
Is there a method to detect when this error occurs so I can display a popup error to notify the user?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
遇到了同样的问题,找到的唯一解决方案是检查
iframe
是否在一段时间后完成加载:所以实际上,批准我的应用程序的用户现在“自动”在
iframe
中登录代码>.其他人会在 5 秒后重定向(对于这 5 秒,我有一些小文字解释了情况)。
也许使用这种方法可以做得更好?
http://static.jtwb.dotcloud.com/测试用例/html/content-disposition-attachment.html
Had a same problem and the only solution found was to check if
iframe
finished loading after some time:So actually, users that approved my app, are now "automatically" signed in within
iframe
.Others are redirected after 5 seconds (for those 5 seconds I have some small text explaining the situation).
Perhaps it could be done better by using this approach?
http://static.jtwb.dotcloud.com/test-cases/html/content-disposition-attachment.html