Skip to content

Remove remotely hosted ONNX runtime URL (Chrome Web Store MV3 warning) - #8

Merged
dhivadhiva merged 2 commits into
mainfrom
fix/cws-remote-code
Nov 13, 2026
Merged

dhivadhiva merged 2 commits into
mainfrom
fix/cws-remote-code

Conversation

@dhivadhiva

Copy link
Copy Markdown
Contributor

The Chrome Web Store warned that Cloakpaste will be removed unless it stops including remotely hosted code (Manifest V3, violation "Blue Argon"). The flagged snippet was in src/offscreen/offscreen.js: https://cdn.jsdelivr.net/npm/onnxruntime-web@…/dist/ort-wasm-simd-threaded.asyncify.mjs

Cause. When transformers.js loads, it sets onnxruntime-web's wasmPaths to jsdelivr. The offscreen page already overrides this with the packaged ort/ files, so the CDN was never contacted. But the URL was still in the bundle, and the store's scan flags it.

Changes

  • scripts/build.mjs: an esbuild plugin swaps that default for the packaged /ort/ folder, so the URL no longer reaches the bundle.
  • scripts/build.mjs: after building, the build fails if any packaged .js/.mjs/.html/.json file names a script CDN (jsdelivr, unpkg, cdnjs, esm.sh, esm.run, skypack, jspm). CI builds on every PR, so a dependency update can't bring it back without failing the build.
  • docs/ARCHITECTURE.md: notes the above.
  • Version 0.1.2, since the store needs a version above the published 0.1.1.

Testing

  • npm test: 26/26
  • npm run build:test && npm run test:e2e (Chrome 157): 12/12, including the model running inside the extension
  • Firefox e2e (Firefox 157): 12/12
  • With the plugin removed, the build fails and names the jsdelivr URL in offscreen.js
  • npm run package output (cloakpaste-0.1.2.zip) contains no jsdelivr reference

The Chrome Web Store flagged src/offscreen/offscreen.js for remotely
hosted code (Manifest V3, violation "Blue Argon"). transformers.js sets
a default wasmPaths on cdn.jsdelivr.net when it loads. The offscreen
page already overrides it with the packaged ort/ files, so the CDN was
never contacted, but the URL was still in the bundle.

The build now swaps that default for the packaged ort/ folder and fails
if any CDN URL is left in the package.
@dhivadhiva
dhivadhiva merged commit 8931dbd into main Nov 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant