Google reCAPTCHA not working

This question was asked earlier here and here . but the solution doesn't work for me, reCAPTCHA sometimes works but most of the time doesn't work on mine localhost

! so I tried to switch to valid https

in my development url on my server, but the problem persists:

Uncaught DOMException: Blocked frame with source " https://www.google.com " from accessing cross-origin frame. recaptcha__fa.js:formatted:10721


    at Kp.f.Yb ( https://www.gstatic.com/recaptcha/api2/r20170411114922/recaptcha__fa.js:413:353 )
    at Kp.xb ( https://www.gstatic.com/recaptcha/api2/ r20170411114922 / recaptcha__fa.js: 409: 59 )

I looked line:10721

in recaptcha__fa.js:formatted

, it seems that the error is coming from var a = Dg().parent.frames[this.Yc];

, which means the code is trying to access parent frames.

Questions:

  • What's wrong with reCAPTCHA?
  • How can I fix this?

PS:

Additional Information:

  • Site structure: Rails
  • I am using tubrolink.
  • This is how I use it (as docs):

<script src="https://www.google.com/recaptcha/api.js?hl=<%= I18n.locale.to_s %>"></script>
      

<div class='g-recaptcha' data-sitekey='<%= ENV["KEY"] %>' data-callback='alert("IT IS OK")'></div>
  	
      

Run codeHide result



EDIT

It just took me a day to figure out that this is the problem bootstrap modal

that is causing the problem ... I put the code outside the modal, everything works fine, but when it is inside the modal, it is not!

Does anyone have a workaround for this?

+3


source to share





All Articles