tesseract.js-chrome-extension
tesseract.js-chrome-extension copied to clipboard
OCR in extension won't work
Hello! I have installed the extension but on button click no OCR occurs... nothing happens. What might be the reason? I just cloned the repo and uploaded the files. The popup opens but that's all
I found this was due to a security policy change. When I right click and view the console in developer tools for the extension, I see that the content policy (which can be defined in the "manifest.json" of the chrome extension) doesn't give access Tessaract.js source files. I tried to work around this using nested injection (one of the injection approaches for content scripts in chrome extensions) but haven't been able to get this to work since it seems like the Tesseract.js file depends on the Worker.js file, and isn't properly accessing the local copy :/
Same thing happening here! Any trick to fix it?
It seems that since the browser implementation of tesseract.js utilizes a WebWorker, which loads code from tesseract.js-core which is hosted on a CDN (documentation found here), any attempts at accessing external resources are rejected. One solution that worked for me was directly loading workerPath and corePath from CDNs, and updating the "content_security_policy" in the manifest as needed. This also removes the need for local installations of the files. I've also loaded tesseract.min.js from a CDN for consistency, although using local installations works fine.
Hello! this is not working with manifest version 3 . any idea how to make this work using manifest version 3 ?