From 44bd0df461e486ef64c67e75b9073344a2a00a07 Mon Sep 17 00:00:00 2001 From: Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> Date: Sat, 14 Jun 2025 02:01:26 +0530 Subject: Fixed confidence being undefined. The confidence rating wasn't being passed from the background script to the content script. --- src/scripts/login/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/scripts/login/index.ts') diff --git a/src/scripts/login/index.ts b/src/scripts/login/index.ts index 6e459a5..bed05f9 100644 --- a/src/scripts/login/index.ts +++ b/src/scripts/login/index.ts @@ -89,11 +89,12 @@ const observer = new MutationObserver((mutationsList, obs) => { { type: "OCR", dataURL }, ({ success, text, confidence }) => { if (success) { - if (confidence < 85) { + const textResult = text.trim(); + if (confidence < 80 || textResult.length !== 6) { // Reset the captcha if confidence is low img.src = "generateCaptcha?" + new Date().getTime(); } else { - captchaInput.value = text; + captchaInput.value = textResult; } } }, -- cgit v1.2.3