Ways to remove iframe iframe api console errors - "locked frame with source ..." in chrome console

I use the youtube iframe api and get the following console error related to blocking the frame from the beginning of http://www.youtube.com . I wonder if anyone can explain why this error only appears on the chrome console and are there any ways to prevent this?

Mistake:

Blocked frame with source " http://www.youtube.com " from access to frame with source code http://youtubetest.appspot.com ". Protocols, domains and ports must match.

+60
javascript youtube youtube-api
Jun 05 '13 at 13:24
source share
2 answers

I had a similar error where the JS error is:

Blocked frame with source " https://www.youtube.com " from access to frame with origin " http://www.yourdomain.com ". Access frame request has the protocol "https", frame access has the protocol "http". Protocol / Protocols must match, YouTube has CORS (Cross Origin Sharing), which is allowed for all domains.

Try to get rid of https:// in the YouTube iframe tag.

You can also take a look at your closing iframe tags. Iframe tags are not single-point tags and must end with the </iframe> character, not the /> .

+10
Jun 27 '13 at 5:41
source share

It seems that today, using the protocol-free URL "//youtube.com", which YouTube places in its OWN TOOL using COOPERATION, it throws protocol matching errors. (sigh). This worked great this week.

If I add https: to the embed url, it stops throwing errors and the iframe API works. It will continue to throw a "Blocked frame with start ..." error, but the JS API will function properly.

+6
Aug 15 '13 at 15:31
source share



All Articles