aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/background/run-ocr.ts1
-rw-r--r--src/background/second-script.ts1
-rw-r--r--src/scripts/login/index.ts7
3 files changed, 9 insertions, 0 deletions
diff --git a/src/background/run-ocr.ts b/src/background/run-ocr.ts
new file mode 100644
index 0000000..d0af073
--- /dev/null
+++ b/src/background/run-ocr.ts
@@ -0,0 +1 @@
+console.log("THIS IS A BACKGROUND script.");
diff --git a/src/background/second-script.ts b/src/background/second-script.ts
new file mode 100644
index 0000000..9e3a621
--- /dev/null
+++ b/src/background/second-script.ts
@@ -0,0 +1 @@
+console.log("THiS IS THE SECOND SCRIPT");
diff --git a/src/scripts/login/index.ts b/src/scripts/login/index.ts
index b7503b9..adbcdbc 100644
--- a/src/scripts/login/index.ts
+++ b/src/scripts/login/index.ts
@@ -1,3 +1,4 @@
+import Tesseract from "tesseract.js";
import { interceptPost, interceptGet } from "@/shared/intercept-jquery-ajax";
function prepareCaptcha(ctx: CanvasRenderingContext2D, width: number, height: number) {
@@ -83,6 +84,12 @@ const observer = new MutationObserver((mutationsList, obs) => {
prepareCaptcha(ctx, canvas.width, canvas.height);
canvas.style.display = "";
const dataURL = canvas.toDataURL("image/png");
+ Tesseract.recognize(canvas, 'eng', {
+ logger: console.log
+ }).then(({ data: { text, confidence } }) => {
+ console.log("OCR Result:", text);
+ console.log("OCR confidence:", confidence);
+ });
// TODO: Perform OCR
// window.postMessage({
// type: "RUN_OCR",