Methods of removing the youtube iframe api console error - “blocked a frame with origin…” in chrome console

前端 未结 2 1499
青春惊慌失措
青春惊慌失措 2021-02-02 05:22

I\'m using the youtube iframe api and get the following console error relating to the blocking of a frame with origin http://www.youtube.com. Was wondering if anyone can explain

2条回答
  •  日久生厌
    2021-02-02 06:04

    I had a similar error where the JS error was:

    Blocked a frame with origin "https://www.youtube.com" from accessing a frame with origin "http://www.yourdomain.com". The frame requesting access has a protocol of "https", the frame being accessed has a protocol of "http". Protocol/Protocols must match, YouTube has CORS (Cross Origin Resource Sharing) enabled to allow across domains.

    Try getting rid of the https:// in your YouTube iframe tag?

    You could also take a look at your closing iframe tags. Iframe tags are not singleton tags and must end with a and not a />.

提交回复
热议问题