Reputation: 6554
I use reCapcha on my local test server. Everything works fine, but I have errors:
Blocked a frame with origin "https://www.google.com" from accessing a frame with origin "http://127.0.0.1:8000". The frame requesting access has a protocol of "https", the frame being accessed has a protocol of "http". Protocols must match.
And
Blocked a frame with origin "https://www.google.com" from accessing a frame with origin "http://127.0.0.1:8000". The frame requesting access has a protocol of "about", the frame being accessed has a protocol of "http". Protocols must match.
in html:
...
<script src='https://www.google.com/recaptcha/api.js'></script>
</head>
...
<div class="g-recaptcha" data-sitekey="..."></div>
How to fix that errors?
Thanks!
Upvotes: 6
Views: 3056
Reputation: 467
If you're using an iframe, this part:
Blocked a frame with origin [url here] from accessing a frame with origin [other url here].
Means it's not going to work. Frames can't interfere with each other, or else people would be able to pilfer your data from one frame in the other one. Check out the same origin policy for more details.
You might be able to simplify things for yourself by getting rid of that mixed-protocol error though: You can access the Google files via http instead of https, so trying that may eliminate half your troubles. (You can also just use a url like this: //www.google.com/recaptcha/api.js
instead of specifying whether to use http or https.)
Upvotes: 1