Unable to post message to http://www.youtube.com. Recipient has origin https://www.youtube.com

javascript, youtube, youtube-api, youtube-data-api, youtube-javascript-api

Solution

It is quite clear to me at this point that this is a major bug in Google/YouTube's API. They have written some bad code somewhere. This bug is not a consistent thing. This is well documented by the fact that everybody's code works just fine for an extended period of time, and then they discover that all of a sudden their sites stop working properly. Additionally, all of my websites that had this problem last week are now working without a glitch - again, without me altering code.

So while it sucks to say this - the onus is on Google & YouTube to fix this and provide APIs that actually work as advertised... It doesn't look to me like there's anything we can do about it on our own :(

Problem

My app at http://beta.billboard.fm is producing errors in my normal browsing session after playing a single song. If i reload the page in incognito, the app works fully. I only recently starting experiencing these issues. I have completed cleared all of the cache and it works again, but only temporarily before throwing the same errors. Additionally I have disable all browser extensions. But, no matter what I do I can't get this error from being thrown by the Youtube API: Unable to post message to http://www.youtube.com. Recipient has origin https://www.youtube.com It looks like there is a mismatch in the security protocols. I tried changing them to https or just removing "http:" all together on my side. But it did not resolve the issue. Any one have an idea what is happening here?

Original source