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