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

前端 未结 2 1502
青春惊慌失措
青春惊慌失措 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:02

    It seems that today, using the protocol-free "//youtube.com" URL that YouTube puts IN THEIR OWN EMBED CODE SNIPPET TOOL is throwing protocol matching errors. (sigh) This worked fine earlier this week.

    If I add the https: to the embed URL it stops throwing errors and the iframe JS API works. It will continue to throw your "Blocked a frame with origin ..." error, but the JS API will function as expected.

提交回复
热议问题