preferences from extension.config.* and applies them during Firefox and Gecko browser launches.
How it works
Configure preferences inextension.config.js (or .mjs / .cjs) under:
browser.<target>.preferencescommands.dev|start|preview.preferences
Preference capabilities
| Preference key | What it does |
|---|---|
browser.<target>.preferences | Sets default preferences for a specific browser target. |
commands.dev.preferences | Sets or overrides preferences for dev runs. |
commands.start.preferences | Sets or overrides preferences for start runs. |
commands.preview.preferences | Sets or overrides preferences for preview runs. |
Firefox and Gecko-based behavior
Example configuration
user.js file into the active profile (managed or explicit profile) and merges:
- internal baseline preferences required for development and runtime behavior
- your custom
preferencesvalues (your values win on key conflicts)
EXTENSION_USE_SYSTEM_PROFILE=true), Extension.js does not write a managed profile file.
Chromium-family behavior
Chromium-family launches (chrome, edge, chromium, chromium-based) primarily use browser flags.
preferences can still exist in merged configuration objects. However, flags and profile options control Chromium launch behavior. Chromium does not use a Firefox-style user.js preference file.
For Chromium customization, prefer:
browserFlagsexcludeBrowserFlagsprofile/persistProfile
Dark mode defaults
Extension.js injects dark-mode defaults unless you already define those keys:- Chromium family: dark-mode launch flags
- Firefox/Gecko family: dark-mode preference keys (for UI + content color scheme)
preferences/flags override these defaults.
Interface example
Example with custom profile
More detailed preference references
For a comprehensive list of available Firefox preferences, explore the Firefox source code. Mozilla defines many defaults inall.js or firefox.js.
Best practices
- Prefer browser-scoped preferences: Keep Firefox/Gecko preference keys under browser-targeted configuration blocks.
- Use command overrides for temporary experiments: Put short-lived preference tweaks in
commands.dev. - Keep profiles isolated: Use separate profiles for reproducible debugging.
- Use flags for Chromium tuning: Treat flags as the primary configuration surface on Chromium-family targets.
Next steps
- Learn more about Browser flags.
- Learn more about Browser profile.

