Browser Launch
Addfox can automatically launch the browser and load the extension during development for improved efficiency.
Quick Start
Run the dev command:
On first start, the dev server will automatically:
- Build the extension
- Launch the browser
- Load the development extension
Using Scripts (Recommended)
Configure scripts in package.json for cleaner browser launch commands:
Then use directly:
Chromium-based Browsers
Addfox natively supports the following Chromium-based browsers:
Launch via CLI Directly
If not using scripts, you can also launch directly via CLI:
Chromium Browser Configuration
If the browser is not in the default location, specify the browser object in config:
Each browser entry supports:
path— browser executable pathprofile— custom user-data (profile) directory; relative paths resolve from the project root (default:<outputRoot>/cache/browser-profile/<name>-user-data)keepBrowserProfile— keep this browser's profile between launches, overriding the top-levelkeepBrowserProfile
browserPath is deprecated. Migrate to browser:
If both are set for the same browser, browser takes precedence.
Platform Examples
macOS:
Windows:
Linux:
Chromium User Data Cache
By default, a new user data directory is used on each start. To preserve data (e.g., stay logged in), add to package.json:
Or run directly via CLI:
Or enable in config:
Or per browser (overrides the top-level keepBrowserProfile):
User data is saved in .addfox/cache/browser-profile/<name>-user-data.
Firefox
Firefox dev mode uses the web-ext tool to manage extension lifecycle.
Launch Firefox
Using the configured script:
Or run directly via CLI:
Firefox Features
- Extension reload is handled by
web-ext, not Addfox's WebSocket - Automatically opens Firefox and loads the extension
- Supports auto-reload on file changes
Firefox Path Configuration
Firefox profile is automatically managed by web-ext, no manual cache configuration needed.
Debugging Tips
View Service Worker
- Open
chrome://extensions/ - Find the extension under development
- Click "Service Worker" to view background script console
View Content Script
- Right-click on the webpage → Inspect
- Switch to Console panel
- Select the extension's context
Use Error Monitor
Add debug scripts to package.json:
Then run:
Or enable directly via CLI:
Related Configuration
browser- Browser configuration (path, profile, keepBrowserProfile)keepBrowserProfile/buildCache- Cache configurationhotReload- Hot reload configurationdebug- Error monitoring configuration

