aboutsummaryrefslogtreecommitdiffstats
path: root/src/scripts/fix-application-receipt.ts
blob: 11dddf0898f80b1a8412988b647c032a0409ab46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const receiptFormElement = document.querySelector("#form_reprint_request")!;
receiptFormElement.removeAttribute("id");
receiptFormElement.removeAttribute("name");
receiptFormElement.removeAttribute("onsubmit");
receiptFormElement.removeAttribute("target");
receiptFormElement.removeAttribute("autocomplete");
receiptFormElement.removeAttribute("rel");

let captchaElement = document.querySelector("#werter > div > div:nth-child(4)");

if (captchaElement) {
	captchaElement = captchaElement!;
	const captchaValueElement = document.querySelector("#captchaText") as HTMLInputElement;
	const captchaFieldElement = document.querySelector("[name=txtDrawText]") as HTMLInputElement;
	const removeCaptcha = () => {
		captchaFieldElement.value = captchaValueElement.value;
		(captchaElement as any).style.display = "none";
		setTimeout(removeCaptcha, 1000);
	};
	removeCaptcha();
}