ReCAPTCHA 2.0 does not appear in Safari (works in Edge, Chrome and Firefox)

I just integrated Google reCAPTCHA 2.0 into my website. It works as expected in Chrome, Firefox, and Edge, but it does not work / does not appear in Safari on my MacBook Pro.

  • MacBook Pro: macOS Sierra version 10.12.2.
  • Safari: version 10.0.2 (12602.3.12.0.1)

reCAPTCHA is used in dhtmlXForm , like this ...

... { type:"label", name:"myrecaptcha", label:"<div class=\"g-recaptcha\" data-sitekey=\"MY_KEY_HERE\"></div>", offsetLeft:320 }, ... 

Which in all browsers except Safari generates this ...

enter image description here

But in Safari it does not appear ...

enter image description here

There are no errors in the console. I cleared the entire browser cache. The api.js line is located immediately before the closing </head> , for example, with Google documentation. Not sure what else to try.

UPDATE:. In Safari, when I check the area in which reCAPTCHA is supposed to be shown, I see only the original <div class="g-recaptcha" data-sitekey="MY_KEY_HERE"></div> in which there is nothing. Therefore, it does not put an iframe in this div for some reason. Hope this helps.

+9
source share
2 answers

1. $('#captcha-form script').remove();

'captcha-form' is the identifier of the form containing captcha. Remove the script tags so that the scripts are not executed the second time that Safari re-displays them after moving jQuery. The event handlers created by the script are not in the script tags, so they survive.

2. Set the links in the reCAPTCHA configuration file from http to https

I just remembered that I recently turned on “Use HTML5 in forms” in the “Fancy General” settings. If I uncheck this box, reCAPTCHA works in Safari.

So this will mean that there is a problem with your implementation of HTML5 in forms, perhaps only surfaces when the site uses HTTPS.

3. For more details, see the links below -

reCAPTCHA2.0 troubleshooting

reCAPTCHA Frequently Asked Questions

google tutorial reCAPTCHA

0
source

I am facing the same problem on my site, in my case it is in Firefox, apparently because JavaScript is disabled (although it is enabled in the browser! And I tested on three different computers) I know this because, because, when I changed the settings for reCaptcha to support browsers that do not support Javascript, it solved the problem for me.

To do this, you can "go to the admin console and move the security settings slider to" the easiest for users. "Keep in mind that with this parameter, reCAPTCHA will not be able to use all its security functions." as stated in reCAPTCHA Frequently Asked Questions

Hope this helps someone narrow down the problem.

PS: I do not have enough reputation to leave a comment.

0
source

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


All Articles