Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to execute 'postMessage' on 'DOMWindow #96

Closed
123ndy opened this issue Jan 16, 2017 · 8 comments
Closed

Failed to execute 'postMessage' on 'DOMWindow #96

123ndy opened this issue Jan 16, 2017 · 8 comments

Comments

@123ndy
Copy link

123ndy commented Jan 16, 2017

I get this message in console: Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://www.youtube.com') does not match the recipient window's origin ('https://mydomain.com').

I have read that a combo of http and https could be the reason, but in this case both the iframe and the hosted domain is using https.

Any idea of what it can be?

@JulianJorgensen
Copy link

Ditto here

@tjallingt
Copy link
Owner

I'm actually not sure, as you might have noticed this error message does not appear very consistently (at least it doesn't for me) and it does not affect the YouTube player functionality. We depend on a chain of NPM modules to load the YouTube player for us so it is also not possible for us to fix this issue inside this module.

@goto-bus-stop
Copy link
Contributor

Yeah, it also sometimes happens when only using the official YouTube JS API. Try refreshing https://gateway.ipfs.io/ipfs/Qmb3ggu57cXHTh3JxCCF4cY3Sds21d4UdZZe6T3W5GfkHL/ a few times with an open console and you should see it pop up sometimes.

@payner35
Copy link

I was expecting this to sort it.. ? still have some sporadic errors.

 playerVars: { // https://developers.google.com/youtube/player_parameters
                       origin: 'https://mywebsite.com',
                       enablejsapi: '1',

@mouhsinelonly
Copy link

did any one find a solution for this ?

@goto-bus-stop
Copy link
Contributor

goto-bus-stop commented Apr 9, 2017

Hmm i did find this just now: brandly/angular-youtube-embed#116

is it fixed if you add

window.YTConfig = {
  host: 'https://www.youtube.com' 
} 

somewhere in your app, before using react-youtube?

@Nufflee
Copy link

Nufflee commented Aug 25, 2018

@goto-bus-stop Doesn't seem to work here.

@WeiXu1991
Copy link

I haven't find a solution for this issue, but I find a way to reproduce this issue.
If you have some tools like Charles, try to block the youtube iframe get call, you will see this error in your console every time.
I checked the Google's js file, they are just running iframe.contentWindow.postMessage, I am guessing that maybe when the iframe content loads slow, the postMessage call was sent to the main window? Not sure how contentWindow and postMessage really work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants