Viewed   4.5k times

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'.

 Answers

3

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

Wednesday, November 16, 2022
2

You must ensure the URL contains embed rather watch as the /embed endpoint allows outside requests, whereas the /watch endpoint does not.

<iframe width="420" height="315" src="https://www.youtube.com/embed/A6XUVjK9W4o" frameborder="0" allowfullscreen></iframe>
Saturday, November 5, 2022
2

Well, apparently Google+ just had a brainfart or something, because the solution was simply to clear my cookies!

I tried using my website on another computer and the Google+ API worked fine (no errors), so I tried clearing the cookies on my desktop and lo and behold, it started working!

Thursday, September 29, 2022
1

teespring.com is telling your visitors' browsers that they should not display it in a frame.

You have four options:

  • Talk to whomever runs teespring.com and convince them not to do that
  • Just link to them instead of trying to shove them into a frame
  • Don't point your visitors to them at all
  • Proxy their site and point the iframe at your proxy (this may step into copyright infringement territory)
Sunday, September 18, 2022
 
5

You are going in the right direction, but exact decorator which you will need to achieve this is 'xframe_options_exempt'.

from django.http import HttpResponse
from django.views.decorators.clickjacking import xframe_options_exempt

@xframe_options_exempt
def ok_to_load_in_a_frame(request):
    return HttpResponse("This page is safe to load in a frame on any site.")

PS: DJango 1.6 is no longer supported. It is good time to get an upgrade.

Wednesday, September 21, 2022
 
joelpt
 
Only authorized users can answer the search term. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :
 
Share