aboutsummaryrefslogtreecommitdiffstats
path: root/src/scripts/autofill-captcha.ts
diff options
context:
space:
mode:
authorArpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>2023-02-04 12:20:46 +0530
committerArpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>2023-02-04 12:20:46 +0530
commita08607762db5681785159358084213558a5f11f9 (patch)
treef3a6245c685ca942ce5fcf918e116509506b7c5a /src/scripts/autofill-captcha.ts
downloadbanglar-bhumi-utils-a08607762db5681785159358084213558a5f11f9.tar.gz
banglar-bhumi-utils-a08607762db5681785159358084213558a5f11f9.zip
Initial commit
Diffstat (limited to 'src/scripts/autofill-captcha.ts')
-rw-r--r--src/scripts/autofill-captcha.ts24
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);