You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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