Add cross-browser popup status handling

This commit is contained in:
Jordan Wages 2026-08-24 23:32:27 -05:00
commit 7e17470356
38 changed files with 1242 additions and 199 deletions

View file

@ -39,6 +39,7 @@ function inputsFor(mode: string): Record<string, string> {
background: mode === "firefox" ? "src/background/firefox.ts" : "src/background/chromium.ts",
inference: "src/inference/worker.ts",
options: "src/options/main.ts",
popup: "src/popup/main.ts",
offscreen: "src/background/offscreen.ts"
};
}
@ -49,6 +50,7 @@ function manifestPlugin(mode: string): Plugin {
generateBundle() {
const filename = mode === "firefox" ? "public/manifest.firefox.json" : "public/manifest.chromium.json";
this.emitFile({ type: "asset", fileName: "manifest.json", source: readFileSync(filename, "utf8") });
this.emitFile({ type: "asset", fileName: "ort/ort-wasm-simd-threaded.jsep.wasm", source: readFileSync("node_modules/onnxruntime-web/dist/ort-wasm-simd-threaded.jsep.wasm") });
}
};
}