Tune browser runtime behavior for development without changing your extension source.
Get repeatable browser behavior during development (for example, homepage defaults, devtools settings, or notification behavior) without editing extension code.
Extension.js reads preferences from extension.config.* and applies them in browser launch flows where supported.
Preferences are configured in extension.config.js (or .mjs / .cjs) under:
browser.<target>.preferencescommands.dev|start|preview.preferencesCommand-level values can override browser defaults.
| Config 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. |
In Firefox/Gecko flows, Extension.js writes a user.js file into the active profile (managed or explicit profile) and merges:
preferences values (your values win on key conflicts)If system profile mode is enabled (EXTENSION_USE_SYSTEM_PROFILE=true), no managed profile file is written.
Chromium-family launches (chrome, edge, chromium, chromium-based) primarily use browser flags.
preferences can still exist in merged config objects, but Chromium launch behavior is controlled by flags/profile args, not a Firefox-style user.js preference file.
For Chromium customization, prefer:
browserFlagsexcludeBrowserFlagsprofile / persistProfileExtension.js injects dark-mode defaults unless you already define those keys:
Your explicit preferences/flags override these defaults.
For a comprehensive list of available Firefox preferences, you can explore the Firefox source code where many default preferences are defined in all.js or firefox.js.
commands.dev.