3

This question has been asked before at here and here. but the solution does not work for me, the reCAPTCHA sometimes works but most of the times doesn't work on my localhost! so I tried to switch to valid https in my development URL on my server, but the problem persists to exist:

Uncaught DOMException: Blocked a frame with origin "https://www.google.com" from accessing a 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 have looked at line:10721 in recaptcha__fa.js:formatted it seems that the error come from var a = Dg().parent.frames[this.Yc]; which it means the code tries to access the parent's frames.

Questions:

  1. What is wrong with reCAPTCHA?
  2. How can I fix this?

P.S:

More info:

  • Site's framework: Rails
  • I use tubrolink.
  • This is how I use it (as documents):

<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>
   

EDIT

It just took me a day to figure out that it's the bootstrap modal that causes the issue... I place the code outside of the modal, everything works fine, but when it's inside the modal it's not!

Has anybody have a workaround for this?

Community
  • 1
  • 1
dariush
  • 3,191
  • 3
  • 24
  • 43
  • maybe your web server config prevent cross origin? https://stackoverflow.com/questions/44288460/google-recaptcha-uncaught-domexception-blocked-a-frame-with-origin-https-www/46069356#46069356 – Shahar Shokrani Sep 07 '17 at 06:45

0 Answers0