diff options
Diffstat (limited to 'src/scripts/autofill-captcha.ts')
| -rw-r--r-- | src/scripts/autofill-captcha.ts | 24 |
1 files changed, 24 insertions, 0 deletions
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); |
