aboutsummaryrefslogtreecommitdiffstats
path: root/src/scripts/captcha.ts
blob: 453443c42a1f49df7d3894f7b33b1e6437476fdb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
const autofillCaptcha = () => {
	const 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";
			}
		}
	}

	setTimeout(autofillCaptcha, 1000);
};

autofillCaptcha();