Warm tip: This article is reproduced from serverfault.com, please click

How to fix Refused to display in a frame because it set 'X-Frame-Options' to 'sameorigin

发布于 2019-05-31 08:03:21

I'm getting error while useing i-frame in angular Refused to display in a frame because it set 'X-Frame-Options' to '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'.

Questioner
Abhijeet Srivastava
Viewed
0
VIKAS KOHLI 2019-12-18 23:12:39

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>

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