Skip to content

feat: Verify Firefox MV2 build target and add web-ext example config#23

Open
skid-dev wants to merge 1 commit into
claude/recursing-goldberg-5b5636from
claude/firefox-build-target
Open

feat: Verify Firefox MV2 build target and add web-ext example config#23
skid-dev wants to merge 1 commit into
claude/recursing-goldberg-5b5636from
claude/firefox-build-target

Conversation

@skid-dev
Copy link
Copy Markdown
Owner

Summary

  • Confirm wxt build -b firefox produces a working Firefox MV2 bundle out of the box — WXT already normalises host_permissions, actionbrowser_action, and web_accessible_resources automatically, and chrome.scripting.* is supported in Firefox 102+.
  • Wire the Firefox MV2 build into CI alongside the Chrome MV3 build.
  • Add web-ext.config.example.ts as a template for the developer-local (gitignored) web-ext.config.ts, plus a Firefox-development section in the README.

What WXT handled without source changes

MV3 input Firefox MV2 output (verified in .output/firefox-mv2/manifest.json)
host_permissions: ["<all_urls>"] merged into permissions: [..., "<all_urls>"]
action: {...} renamed to browser_action: {...}
web_accessible_resources: [{ resources, matches }] flattened to web_accessible_resources: [string, ...]
background.service_worker rewritten to background.scripts
permissions: [..., "scripting", ...] passed through — Firefox 102+ supports browser.scripting in MV2
commands passed through unchanged

Test plan

  • npm install --ignore-scripts
  • npx wxt prepare
  • npx wxt build — Chrome MV3 build still passes (regression check)
  • npx wxt build -b firefox — Firefox MV2 build succeeds with no warnings
  • npx wxt zip -b firefox — produces .output/schoolbox-chrome-extension-1.3.0-firefox.zip
  • npx tsc --noEmit — typecheck clean
  • Manual smoke test in Firefox (out of scope here — this PR is a build-target verification)

🤖 Generated with Claude Code

WXT already normalises the MV3 manifest (host_permissions, action,
web_accessible_resources) into MV2 shape, and the chrome.scripting API
used by the background worker is supported in Firefox 102+. No source
changes needed — wxt build -b firefox produces a working MV2 bundle.

- Add Firefox MV2 build step to CI alongside the Chrome MV3 build so the
  Firefox target stays green on every push.
- Suppress the AMO data-collection-permissions warning; the consent
  requirement only applies to brand-new AMO listings.
- Add web-ext.config.example.ts as a template for the developer-local
  web-ext.config.ts (already gitignored) that customises browser
  binaries and start URLs.
- Document the Firefox dev workflow and the web-ext.config copy step
  in the README.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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