Simulate click with javascript on google captchas is possible?

As most of you already know google captchas work loading component by using javascript. It has also protection called Cross-Origin and it should be specified in headers. However, it seems that with the right javascript code it could be possible to simulate clicks on captchas. My goal is to click on recaptcha-audio-button loaded after the pressure of the button which verifies human presence. It seems also not possible to switch among the active windows to access the correct frame due to the cross-origin protection.
I’m trying to make a chrome extension in order to reach my goal, but it seems very difficult. The button wich verifies the human presence is clickable with the following code:

document.documentElement.getElementsByClassName('recaptcha-checkbox-checkmark')[0].click();

And it works as well, but if I try

document.querySelector(".audio-button-holder").getElementsByTagName("button")[0].click()  

without accessing HTML (or to be precise: the javascript code) it doesn’t work and throw an error.
With chrome driver captcha block attempts of clicks on the audio button so it doesn’t work
Do you have any idea to do this?

What you are trying to do has already been done. Search GitHub for source code. You will also need to downgrade your chrome as disabling web security won’t work. I think I landed up on a version between 50 and 60, where chrome didn’t force SOP.

I found something some time ago but nothing works… can you link what are you referencing about?

This is working fine when I tested it.

You will need an older version of Chrome, ofcourse. ReCaptcha isn’t 100% dumb, so your activity will raise questions and you will get caught many times… I’ll leave it out to you to figure a way to make it less obvious :wink:

Already tried that javascript code when i made my own extension on chromium but it doesn’t work… is due by the chromium version?

Yes, most probably. Downgrade. SOP is a bitch.

Trying with chromium version 55.0.2883.95 with this javascript code:

document.querySelector('[title="recaptcha challenge"]').contentWindow.document.getElementById("recaptcha-audio-button").click();

Seems not working beacuse of cannot contentWindow of null element.

This topic was automatically closed after 121 days. New replies are no longer allowed.