Failed to execute 'postMessage' on 'DOMWindow'
See original GitHub issueI last worked on my project about a month ago. At that time, I was able to get Youtube videos to load and play properly in react-player. After coming back, I’ve discovered that something seems to have changed and now the video won’t load. I end with the following error:
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://www.youtube.com') does not match the recipient window's origin ('http://localhost:8000').
I’ve looked up some StackOverflow questions about it and I’ve read that it’s an error coming from the Youtube iFrame API when you make a request for a Youtube video over http instead of https. I put some logging in the react-player library and saw that the requests are supposedly being made over https, so I don’t think that’s the issue I’m having here.
Does anyone have any insight into this?
As an aside, I’m using Gatsby as my platform. Not sure if this really matters.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:17
- Comments:25 (4 by maintainers)
Top Results From Across the Web
Failed to execute 'postMessage' on 'DOMWindow': https://www ...
I believe this is an issue with the target origin being https . I suspect it is because your iFrame url is using...
Read more >Failed to execute 'postMessage' on 'DOMWindow ... - GitHub
Hi David, I face an issue when using your scripts in sharepoint sites. Failed to execute 'postMessage' on 'DOMWindow': The target origin (https://....
Read more >Failed to execute 'postMessage' on 'DOMWindow'
Youtube player widget, out of nowhere, started to show errors in browser console. www-widgetapi.js:758 Failed to execute 'postMessage' on 'DOMWindow': The ...
Read more >Failed to execute 'postMessage' on 'DOMWindow': The target ...
Currently, I'm facing an issue. Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://companyName--c.visualforce.
Read more >Solved: Re: Failed to execute 'postMessage' on 'DOMWindow'
I get this error: Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://service.mydomain.com') does not match the recipient ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m aware of the issue, but afaik it’s a problem with with the Youtube iFrame API based on whatever URL you are calling the API from, and it’s not very consistent. This issue should remain closed unless there is a specific problem that ReactPlayer is causing.
There are plenty of mentions of the error elsewhere: https://www.google.com/search?q=youtube+iframe+Failed+to+execute+'postMessage'+on+'DOMWindow'%3A
However, ReactPlayer already tries to implement the solutions posted, eg adding the
origin
property to theplayerVars
. Also note this commit that pinned the API URL tohttps
to try and prevent this issue.If the error is still occurring (and not consistently) then I’m not sure what else can be done in this library.
I’m getting the same warning although the videos work, did you resolve it?