ambethia / recaptcha

ReCaptcha helpers for ruby apps
http://github.com/ambethia/recaptcha
MIT License
1.97k stars 440 forks source link

Chrome raises 'cross-origin security exception' and recaptcha fails when inside a TBS Modal #198

Open eozelius opened 8 years ago

eozelius commented 8 years ago

Hello, I am experiencing a strange issue that is specific to Chrome Version 52.0.2743.82 m (64-bit) from a windows 7, MacOS, and linux mint machines.

I have a Twitter Bootstrap 3.3.7 modal with form, and a recaptcha inside the modal.

<div id="entry" class="modal" role="dialog"> ... <%= recaptcha_tags> </div>

The reCaptcha works for all other browsers, but in Chrome the blue spinner just continues to turn indefinitely. The JS error in the console is as follows

Uncaught SecurityError: Blocked a frame with origin "https://www.google.com" from accessing a frame with origin "https://rndev.mcfinternal.com". Protocols, domains, and ports must match.

The issue can be viewed/tested at https://rndev.mcfinternal.com/ (you will get a warning that we are using a self-signed cert.) Or at http://recognitionnotes.com/ (production site)

Thank you for your help.

grosser commented 8 years ago

Don't think this is anything the library can fix ... should go to google with that ... maybe check their example implementation to see if we are doing anything wrong here and check their example to see if it works on your site ...

yeseniamolinab commented 8 years ago

@eozelius @grosser exact same thing is happening to me with chrome 53.0.2785.143 m (64-bit) is this a recaptcha bug? or a chrome bug?

Recaptcha is working fine in Firefox and Edge.

grosser commented 8 years ago

see previous comment ... afaik nobody checked yet ...

eozelius commented 8 years ago

Interestingly, I removed the captcha from the modal, and it is still not working.

Unfortunately the issue is not testable right now, since I disabled recaptcha for chrome users, and it is a production site.

I will try to set up a test server soon so that you can see the issue and hopefully provide some guidance on what is going wrong.

Thanks for the help. @grosser