Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect when reCaptcha does not load

Tags:

What is the best way to detect if a reCaptcha v2 does not load? I would like to alert users when they need to use the captcha to continue, but it was unable to load.

like image 457
Matt Avatar asked Mar 03 '16 20:03

Matt


People also ask

What to do if reCAPTCHA is not working?

Make sure your browser is fully updated (see minimum browser requirements) Check that JavaScript is enabled in your browser. Try disabling plugins that might conflict with reCAPTCHA.

How do I know if my reCAPTCHA is working?

You can test invisible recaptcha by using Chrome emulator. You will need to add a new custom device (BOT) in developer tools, and set User Agent String to Googlebot/2.1 on Desktop . Then use the new BOT device when testing on your site to trigger the recaptcha authentication.

Why reCAPTCHA is not showing sometimes?

If reCAPTCHA is not working in your browser, then this issue may arise due to several reasons that include: You are using an older version of your web browser. VPN or proxy service is interrupting with reCAPTCHA. The browser is infected with malware like a browser hijacker, trojan, adware tool, etc.

Why is reCAPTCHA not working on Chrome?

Chrome is not updated to the latest version One of the most common reasons why this error occurs is that of an outdated Chrome version. reCAPTCHA will actively look at the browser version before allowing you access. This is applicable to all browser versions, not just Chrome.


1 Answers

You can pass a callback function when you make the request for the captcha

Add this to the url:

?onload=myfunction

for example:

 <script src="https://www.google.com/recaptcha/api.js?onload=loadedCallback&render=explicit"
        async defer>
    </script>

Js:

function loadedCallback(){
//Recaptcha its loaded
}
like image 152
Ernesto Mayoral Cabezas Avatar answered Nov 13 '22 13:11

Ernesto Mayoral Cabezas