Firefox support - #17
Merged
Merged
Conversation
Both browsers now build from the same sources. `manifest.config.ts` generates the manifest per target and `vite.config.ts` requires `EXTENSION_TARGET` to name one, so the two targets are peers: `build:chrome` writes `dist-chrome/`, `build:firefox` writes `dist-firefox/`, and there is no bare `pnpm build` that quietly favours one browser. The version comes from package.json at build time, so the hand-maintained manifest.json is gone. Firefox has no MV3 service worker, so it loads the same background bundle as an event page, which the existing dependency-free bundling already allowed. It also ships none of the declarativeNetRequest enum objects, so the tab header rule is written with the wire strings both browsers accept, and host permissions are revocable per site there, which the panel now detects and reports in a banner instead of looking like an app without a recorder. devtools.html moved to the root of the build because Firefox resolves the panel path against that page's own URL. Firefox gets one automated smoke test on top of that, as its own Playwright project. It cannot use the Chrome fixtures, since Playwright loads extensions in Chromium only, so it installs the add-on over Firefox's Remote Debugging Protocol and reads the background page and the panel through the same channel: Playwright never attaches to a privileged moz-extension page, not even one the extension opens itself. CI also runs web-ext lint over the Firefox build, which is what AMO validates on submission. BROWSERS.md documents where the two targets differ, what the smoke test does and does not cover, the manual checklist for the rest and what each store needs at submission.
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.
This PR adds Firefox support to the Inertia.js DevTools extension while keeping both browsers on the same sources. Firefox cannot run the MV3 service worker used by Chrome, so it loads the same background bundle as an event page and receives its own generated manifest with a stable Gecko ID, minimum version, and AMO data-collection declaration. It also accounts for Firefox’s missing DNR enum objects, revocable per-site permissions, and different DevTools panel path resolution. CI validates both builds, and releases now contain separate Chrome and Firefox archives.
The E2E suite required a larger rewrite because Playwright can only load extensions in Chromium, while its bundled Firefox does not reliably inject extension content scripts. Playwright still handles test discovery, assertions, and reporting, but Selenium now starts and drives a fresh Chrome or Firefox session for every test and installs the corresponding extension.
Fixes #12