Replies: 1 comment
-
I am working on something that requires ONNX Runtime Web for gmail as well (different object). I was wondering if you ever figured out a clean solution here? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi friends,
I’m working on integrating ONNX Runtime Web (using npm and JavaScript) into a Chrome Manifest V3 extension to analyze Gmail emails. My goal is to run ONNX models for spam detection directly in the browser using WASM for performance and privacy.
I’ve tried several runtime variants (e.g., ort.min.js, ort.wasm.min.js) and adjusted env.wasm settings (numThreads=1, simd=false). I’ve ensured the .wasm file is fetched with chrome.runtime.getURL() and assigned to env.wasm.wasmBinary before calling env.wasm.init(). I’ve verified the .wasm file and JS files are in web_accessible_resources, and I’ve set wasm-unsafe-eval in the CSP.
Despite these efforts, I still get errors like:
[ERROR] Setup failed: no available backend found. ERR: [wasm] TypeError: Failed to fetch ...
It seems the WASM backend initialization is failing in the extension environment.
I’ve tried:
Different ONNX runtime builds (e.g., ort.all.min.js vs ort.min.js).
Adjusting CSP and ensuring files are accessible.
Simplifying the setup to just a single WASM runtime and a small test model.
I’m looking for advice on:
Confirmed working configurations of onnxruntime-web in MV3 extensions.
Any additional steps for properly initializing WASM in this environment.
If anyone has managed a similar setup or can suggest a known working approach, I’d appreciate the guidance.
Beta Was this translation helpful? Give feedback.
All reactions