Repository navigation
Remove remotely hosted ONNX runtime URL (Chrome Web Store MV3 warning) - #8
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.mjsCause. When transformers.js loads, it sets onnxruntime-web's
wasmPathsto jsdelivr. The offscreen page already overrides this with the packagedort/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/.jsonfile 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.Testing
npm test: 26/26npm run build:test && npm run test:e2e(Chrome 157): 12/12, including the model running inside the extensionoffscreen.jsnpm run packageoutput (cloakpaste-0.1.2.zip) contains no jsdelivr reference