Avoid maintaining separate manifest files for every browser.
Extension.js lets you define browser-specific values inline with prefixes, then emits only the fields that match the active target at compile time.
Browsers still differ in key manifest areas, like background configuration and vendor metadata. Prefixed fields let you keep one source manifest.json while producing browser-correct output for Chromium and Firefox families.
Extension.js scans manifest keys and resolves prefixed entries for the selected browser:
chrome, edge, chromium-based) resolve: chromium:, chrome:, edge:firefox, gecko-based) resolve: firefox:, gecko:When a prefixed key matches the active target, Extension.js rewrites it to the unprefixed key in the emitted manifest.
You can also target vendor-specific variants inside the same browser family:
This makes service_worker available only for Chromium-family outputs while keeping background.scripts for Firefox outputs.
Supported prefix map:
| Prefix | Included for target browser |
|---|---|
chromium: |
chrome, edge, chromium-based |
chrome: |
chrome, chromium-based |
edge: |
edge, chromium-based |
firefox: |
firefox, gecko-based |
gecko: |
firefox, gecko-based |
This works for any manifest field at any level, including permissions, content_scripts, and background.
dist/<browser>) to catch compatibility regressions early.