reCAPTCHA not rendering

rails
preview

#1

Hello I have an rails application, i can run the application but my recaptcha code does not work. Then i open my enviroment on an vm on virtual box and put the same code, it’s work! C9.io does not render recaptcha on preview.


#2

This could be because by default cloud9 opens your website using HTTPS. Your captcha might be loaded via HTTP. When you pop out your preview and change the url to HTTP you might find the issue is resolved.


#3

Still not working :frowning:


#4

Can you include a screenshot of your browser console?


#5

The same code render a reCaptcha if it run’s using virtual box vm


#6

Hi,

Looking at the errors, it appears the captcha wants wants to do something that isn’t allowed in the sandboxed iframe the preview is loaded in. You can open your running application on a separate tab and it should work there. To quickly open the preview in a separate tab, click on the icon near the top right of the preview pane that has a diagonal arrow within a box. Do let us know if that still doesn’t work.

Regards,
​Mutahhir


#7

Still not working :frowning:


#8

Can you post another screenshot of the console log with the new tab? Also, quick question: Are you showing the reCaptcha within an iframe of your own app?


#9

i was tested my app in new tab without https and it work’s. I can’t run app in http mode without launching new tab.

Resolution: Recaptcha only works in new tab without https protocol.

It can be improved?

Thanks


#10

Hi,

If the reCaptcha code wants access to features that are unavailable in the preview iframe, then it won’t be possible. However, one thing to note here is that the new tab supports both HTTP and HTTPS. Can you try the site on a new Tab with HTTPS? If it doesn’t work, please paste the error screenshot.

Thanks!

Regards,
​Mutahhir


#11

@mutahhir , i was tested my application today and it works in https mode also (using new tab feature). Thanks for all support.