NopeCHALLC / nopecha-extension

Automated CAPTCHA solver for your browser. Works with Selenium, Puppeteer, Playwright, and more.
MIT License
5.72k stars 79 forks source link

DOM hint element when extension is solving or finished solving a captcha #47

Open StigP1337 opened 1 month ago

StigP1337 commented 1 month ago

Do you have plans to add some kind of (optional) hint to the DOM of a website which indicates if the extension is currently solving a captcha and/or finished solving a captcha?

I am using the "automation build" version of the extension with a Python Selenium script and it would be easier in some cases to know when solving of the captcha is finished or still in progress.

A (hidden) element in the DOM with a unique id and a status value would be nice.

j-w-yun commented 1 month ago

@StigP1337

We have received similar requests from other users and have seriously considered implementing this feature. However, our primary concern has been maintaining stealth. Introducing changes to the DOM or dispatching Javascript events/messages could potentially be detected by captcha providers, which would compromise the functionality of our extension.

Due to these security implications, we have not implemented such features to date. If you, or anyone in the community, knows of a method to achieve this functionality that remains undetectable by captcha systems, we would be very interested in exploring it further. Please feel free to share your ideas.

j-w-yun commented 1 month ago

For now, can navigate into the iframe (for which the methods of doing so vary depending on how you're automating; for injected Javascript, you can just contentWindow.document into the iframe element. For Selenium and other browser automation tools, you can switch to the iframe, IIRC via switch_to?), and detect for the appropriate selectors of a checkmark.

Le0Developer commented 1 month ago

Most CAPTCHAs also already natively expose such events.

DOM

Turnstile, hCaptcha and Text CAPTCHA will all put their token into a hidden<input> element you can check for updates (reCAPTCHA uses a hidden textarea element).

Events

Additionally, since all CAPTCHAs (except text captcha) use iframes, you can listen in on their communication by just listening to message events. They will all dispatch a "done" event from the iframe to your main javascript context with the CAPTCHA token.

StigP1337 commented 1 month ago

Thank you for the reply. I will try your suggestions. I didn't thought about checking for the token or the message events.