browser

browser configures the browsers used during addfox dev to open and load the extension: executable path, user-data (profile) directory, and whether to keep the profile between launches.

Overview

  • Type: Record<BrowserName, { path?: string; profile?: string; keepBrowserProfile?: boolean }>
  • Default: undefined (uses system default paths)
  • Required: No

Each browser entry supports:

  • path — browser executable path
  • profile — 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-level keepBrowserProfile

Chromium-based Browsers

The following Chromium-based browsers are supported:

BrowserConfig KeyDefault Path
Google ChromechromeAuto-detected
ChromiumchromiumAuto-detected
Microsoft EdgeedgeAuto-detected
BravebraveAuto-detected
VivaldivivaldiAuto-detected
OperaoperaAuto-detected
ArcarcAuto-detected

Configuration Example

// addfox.config.ts
export default defineConfig({
  browser: {
    chrome: { path: "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" },
    edge: { path: "/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge" },
  },
});

Launch via CLI

pnpm
npm
yarn
bun
pnpm dev -- -b chrome
pnpm dev -- -b edge
pnpm dev -- -b brave

Firefox

Firefox uses the web-ext tool to manage extensions. The path configuration is the same:

export default defineConfig({
  browser: {
    firefox: { path: "/Applications/Firefox.app/Contents/MacOS/firefox" },
  },
});

Launch Firefox

pnpm
npm
yarn
bun
pnpm dev -- -b firefox
Info

Firefox development mode uses the web-ext tool. Extension reload is handled by web-ext, not Addfox's WebSocket.

Platform Examples

macOS

export default defineConfig({
  browser: {
    chrome: { path: "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" },
    edge: { path: "/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge" },
    firefox: { path: "/Applications/Firefox.app/Contents/MacOS/firefox" },
  },
});

Windows

export default defineConfig({
  browser: {
    chrome: { path: "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe" },
    edge: { path: "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe" },
  },
});

Linux

export default defineConfig({
  browser: {
    chrome: { path: "/usr/bin/google-chrome" },
    chromium: { path: "/usr/bin/chromium-browser" },
    firefox: { path: "/usr/bin/firefox" },
  },
});

Deprecated: browserPath

browserPath still works but prints a deprecation warning in the terminal. Migrate to browser:

// Before (deprecated)
export default defineConfig({
  browserPath: { chrome: "/path/to/chrome" },
});

// After
export default defineConfig({
  browser: { chrome: { path: "/path/to/chrome" } },
});

If both browserPath and browser set a path for the same browser, browser takes precedence.