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 '' in a frame because it set 'X-Frame-Options' to 'sameorigin'.



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

<iframe class="doc" src=""></iframe>

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

Wednesday, November 16, 2022

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="" frameborder="0" allowfullscreen></iframe>
Saturday, November 5, 2022

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 is telling your visitors' browsers that they should not display it in a frame.

You have four options:

  • Talk to whomever runs 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

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

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
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 :