如何修复拒绝显示在框架中,因为它将"X-Frame-Options"设置为"sameorigin" [英] How to fix Refused to display in a frame because it set 'X-Frame-Options' to 'sameorigin

查看:1189
本文介绍了如何修复拒绝显示在框架中,因为它将"X-Frame-Options"设置为"sameorigin"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用角度拒绝"的i框架以在框架中显示时出现错误,因为它将"X-Frame-Options"设置为"sameorigin"

I'm getting error while useing i-frame in angular Refused to display in a frame because it set 'X-Frame-Options' to 'sameorigin'

拒绝显示" https在框架中://docs.google.com/gview?url = https://subtreebucket.s3.amazonaws.com/docsFile_1559124133664_dummy.pdf ",因为它会将"X-Frame-Options"设置为"sameorigin"

Refused to display 'https://docs.google.com/gview?url=https://subtreebucket.s3.amazonaws.com/docsFile_1559124133664_dummy.pdf' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

推荐答案

请在安全管道中使用santizer,然后添加如下链接

Please use santizer with safe pipe and then include the link as below

<iframe class="doc" src="https://docs.google.com/gview?url=https://subtreebucket.s3.amazonaws.com/docsFile_1559124133664_dummy.pdf&embedded=true"></iframe>

在iframe中添加源代码时,请确保您使用的是Embedded = true.肯定会的

Make sure you are using embedded=true while adding source in the iframe. It'll definitely work

这篇关于如何修复拒绝显示在框架中,因为它将"X-Frame-Options"设置为"sameorigin"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆