5

我正在使用 google reCaptcha v2.0,当我尝试使用示例 html 页面执行此操作时,它在同一个域中工作,但当我尝试与完整的生产页面集成时,同样的事情不起作用。单击 reCaptcha 复选框后,它有时会继续加载,之后它会详细抛出以下错误。

Uncaught SecurityError: Blocked a frame with origin "https://www.google.com" from accessing a frame with origin "http://my.site.com". The frame requesting access has a protocol of "https", the frame being accessed has a protocol of "http". Protocols must match.

我尝试删除 http、https 并保留 // 以便站点协议可以匹配但没有运气。如果有人在这里有解决方案,那将是一个很大的帮助。

提前致谢。

4

2 回答 2

2

当 src 在 https 上运行时,您的 Web 服务器必须启用 SSL

于 2017-09-07T06:38:05.387 回答
0

将 recaptcha 库 URL 从 https 更改为 http

Chrome 和其他现代浏览器将避免将 HTTP 与 HTTPS 混合使用。

于 2016-05-26T10:31:12.237 回答