删除youtube iframe api控制台错误的方法 - “阻止带有原始的框架......”在chrome控制台中 [英] Methods of removing the youtube iframe api console error - "blocked a frame with origin..." in chrome console

查看:86
本文介绍了删除youtube iframe api控制台错误的方法 - “阻止带有原始的框架......”在chrome控制台中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用youtube iframe api并获取以下控制台错误,该错误与阻止具有原点的框架有关 http:/ /www.youtube.com 。想知道是否有人可以解释为什么这个错误只出现在Chrome控制台中并且是否有任何方法可以防止这种情况发生?

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 why this error is only appearing in the chrome console and if there are any ways to prevent this happening?

错误:

阻止了一个原始框架 http://www.youtube .com 访问带有来源的框架 http://youtubetest.appspot.com 。协议,域和端口必须匹配。

Blocked a frame with origin "http://www.youtube.com" from accessing a frame with origin "http://youtubetest.appspot.com". Protocols, domains, and ports must match.

推荐答案

我遇到类似的错误:JS错误:

I had a similar error where the JS error was:


阻止原始框架 https://www.youtube.com 访问带有来源的
框架 http://www.yourdomain.com 。请求
访问的帧具有https协议,被访问的帧具有
协议http。协议/协议必须匹配,YouTube允许跨域使用CORS
(跨源资源共享)。

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.

尝试获取删除YouTube iframe广告代码中的 https://

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

您还可以查看关闭的iframe代码。 iframe代码不是单件代码,必须以< / iframe> 结尾,而不是 />

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

这篇关于删除youtube iframe api控制台错误的方法 - “阻止带有原始的框架......”在chrome控制台中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆