I
I
Islam Ibakaev2017-11-03 07:51:11
YouTube
Islam Ibakaev, 2017-11-03 07:51:11

Failed to execute 'postMessage' on 'DOMWindow': The target origin provided does not match the recipient window's origin?

I had to make my own button for youtube video, I had to use youtube iframe api.
Everything worked, only in the console this error
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided (' https://www.youtube.com ') does not match the recipient window's origin (' champ-food.ru ').
It does not seem to affect anything, but it is an eyesore. How to remove this error?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yuri, 2017-11-03
@opposit

Where there is a video call in the iframe, try changing youtube.com/....... to https://youtube.com/.......

L
Lev Rozanov, 2021-04-05
@rozanov

Suddenly, to whom it is useful. You need to add to the parameters:
origin: location.hostname

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question