Open renyuneyun opened 6 months ago
Firefox doesn't allow remote code execution when using extension manifest version 3. Localhost is technically an external/remote source, as you the extension is loaded from your hard drive. See mv3 migration guide
You can run vite build --watch when developing for Firefox. It's not as nice as just running vite-dev for Chromium browsers with HMR. I'm using web-ext to automatically start Firefox with the extension and autoreload on changes.
Thanks for sharing the info about vite build --watch
, @jhholm. I for one wasn't familiar with that command.
Bug 1864284 appears to be the relevant feature request for Firefox. In comment 3, @Rob--W indicated that he's "leaning towards … allowing localhost and 127.0.0.1 for temporarily loaded add-ons only." Until someone is able to land that change, vite build --watch
should at least unblock @crxjs/vite-plugin users.
Build tool
Vite
Where do you see the problem?
Describe the bug
After following the instruction to create a new project and loaded into browser, the extension won't actually load correctly. Clicking on the icon will show the following page:
Error messages appear in browser console (see below).
Reproduction
plugins: [crx({ manifest, browser: 'firefox' })],
invite.config.js
(saw this by seeing this post)npm run dev
)about:debugging#/runtime/this-firefox
-- select "load temporary extension" -- select the manifest file indist/
directory)Logs
System Info
Severity
blocking all usage of RPCE