From a08607762db5681785159358084213558a5f11f9 Mon Sep 17 00:00:00 2001 From: Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> Date: Sat, 4 Feb 2023 12:20:46 +0530 Subject: Initial commit --- src/scripts/autofill-captcha.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/scripts/autofill-captcha.ts (limited to 'src/scripts/autofill-captcha.ts') diff --git a/src/scripts/autofill-captcha.ts b/src/scripts/autofill-captcha.ts new file mode 100644 index 0000000..8caac1c --- /dev/null +++ b/src/scripts/autofill-captcha.ts @@ -0,0 +1,24 @@ +setInterval(() => { + let captchas = Array.from(document.querySelectorAll("#txtCaptcha")) as HTMLInputElement[]; + + for (const captcha of captchas) { + const captchaInput = captcha.parentElement!.querySelector("#txtInput") as HTMLInputElement | null; + if (captchaInput) { + captchaInput.value = captcha.value.replaceAll(" ", ""); + captchaInput.style.display = "none"; + captcha.style.display = "none"; + } + } + + captchas = Array.from(document.querySelectorAll("#captchaText")) as HTMLInputElement[]; + for (const captcha of captchas) { + const captchaParentElement = captcha.parentElement!; + if (captchaParentElement.id === "drawTextSpan") { + const captchaInput = captchaParentElement.parentElement!.querySelector("#drawText1") as HTMLInputElement | null; + if (captchaInput) { + captchaInput.value = captcha.value.replaceAll(" ", ""); + captchaParentElement.parentElement!.style.display = "none"; + } + } + } +}, 5000); -- cgit v1.2.3