Take the 2-minute tour ×

I'm using the youtube iframe api and get the following console error relating to the blocking of a frame with origin http://www.youtube.com. Was wondering if anyone can explain why this error is only appearing in the chrome console and if there are any ways to prevent this happening?


Blocked a frame with origin "http://www.youtube.com" from accessing a frame with origin "http://youtubetest.appspot.com". Protocols, domains, and ports must match.

share|improve this question
Are you running the page in https? What does the html code look like for the include? –  epascarello Jun 5 '13 at 13:44
Ok found the answer code.google.com/p/chromium/issues/detail?id=17325 –  styler Jun 5 '13 at 14:18
@styler I went through your answer link, but didn't understand how you solved it ? Can you please let me know here. –  coding_idiot Jun 28 '13 at 0:39
@styler After reading through that comment thread you linked, I gather the answer is, we're at the mercy of the Chrome team's laziness/stubbornness and cannot get rid of the error? Or did I miss something? –  relic180 Jul 12 '13 at 0:32
Are you blocking third-party cookies? Blocking them can also cause this error. –  wpoely86 Aug 9 '13 at 9:39
show 1 more comment

3 Answers

I had a similar error where the JS error was:

Blocked a frame with origin "https://www.youtube.com" from accessing a frame with origin "http://www.yourdomain.com". The frame requesting access has a protocol of "https", the frame being accessed has a protocol of "http". Protocol/Protocols must match, YouTube has CORS (Cross Origin Resource Sharing) enabled to allow across domains.

Try getting rid of the https:// in your YouTube iframe tag?

You could also take a look at your closing iframe tags. Iframe tags are not singleton tags and must end with a </iframe> and not a />.

share|improve this answer
apart from coming up in the console has this caused any issues on the site? Is there any other way to get around this as sometimes users get the embed code themselves so it might be beyond them to edit any of the code? –  ak85 Aug 14 '13 at 21:30
add comment

It seems that today, using the protocol-free "//youtube.com" URL that YouTube puts IN THEIR OWN EMBED CODE SNIPPET TOOL is throwing protocol matching errors. (sigh) This worked fine earlier this week.

If I add the https: to the embed URL it stops throwing errors and the iframe JS API works. It will continue to throw your "Blocked a frame with origin ..." error, but the JS API will function as expected.

share|improve this answer
add comment

It is security crossdomain politics of Chrome console

share|improve this answer
add comment

Your Answer


