Locked frame in reCapcha

I am using reCapcha on my local test server. Everything is working 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 these errors?

Thanks!

+6
source share
1 answer

If you use iframe, this part:

Blocked source frame [url here] from accessing frame with source [other URL here].

Means this will not work. Frames cannot interfere with each other, otherwise people will be able to steal your data from one frame to another. Check out the same origin policy for more details.

Perhaps you can simplify your things by getting rid of this error in the mixed protocol: you can access Google files via http instead of https, so trying to fix half of your problems. (You can also just use the URL: //www.google.com/recaptcha/api.js instead of indicating whether to use http or https.)

+1
source

Source: https://habr.com/ru/post/978690/


All Articles