未捕获的安全错误:阻止了来源为“https://www.google.com”的框架访问来源为“http://my.site.com”的框架。

Ksh*_*her 5 javascript jquery google-api recaptcha google-developer-tools

我正在使用 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 并保留 // 以便站点协议可以匹配但没有运气。如果有人在这里有解决方案,那将是一个很大的帮助。

提前致谢。

Jes*_*ini 1

将 recaptcha 库 URL 从 https 更改为 http

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