Use dev for day-to-day browser extension development with watch mode, browser launch, and context-aware update behavior.
dev runs the development pipeline, watches project files, and applies update strategies based on what changed (HMR, hard reload, or restart-required diagnostics).
dev--source.Use build for production artifacts, start for production build + launch, and preview to run existing build output only.
dev gives you| Capability | Outcome for developers |
|---|---|
| Watch mode iteration | Tight edit -> rebuild -> validate loop while coding |
| Browser-target control | Explicit cross-browser validation per command |
| Profile-aware runs | Reliable fresh or persisted profiles by workflow need |
| Source inspection mode | Structured output and diagnostics with source flags |
If no path is provided, Extension.js uses process.cwd().
| Flag | Alias | What it does | Default |
|---|---|---|---|
[path or url] |
- | Extension path or remote URL. | process.cwd() |
--browser <browser> |
-b |
Browser/engine target (chromium, chrome, edge, firefox, engine aliases, or comma-separated values). |
chromium |
--profile <path|boolean> |
- | Browser profile path or boolean profile mode. | fresh profile |
--chromium-binary <path> |
- | Custom Chromium-family binary path. | system default |
--gecko-binary <path> |
--firefox-binary |
Custom Gecko-family binary path. | system default |
--polyfill [boolean] |
- | Enable compatibility polyfill behavior. | false |
--starting-url <url> |
- | Starting URL in launched browser. | unset |
--port <port> |
- | Dev server port. | 8080 |
--no-open |
- | Do not automatically open browser. | browser opens by default |
--no-runner |
- | Do not launch browser runner. | runner enabled |
--extensions <list> |
- | Comma-separated companion extensions or store URLs. | unset |
--install [boolean] |
- | Install project dependencies when missing. | command behavior default |
--author |
--author-mode |
Enable maintainer diagnostics. | disabled |
Use source options only with dev:
--source <url> to run from a remote extension source--watch-source / --no-watch-source to control remote polling behaviorstart and preview do not support source-inspection flags.
| Flag | What it does | Default behavior |
|---|---|---|
--source [url] |
Enable source inspection flow. | disabled |
--watch-source [boolean] |
Re-print source output on watched updates. | true when --source is enabled |
--source-format <pretty|json|ndjson> |
Output format for source inspection. | falls back to log format or json |
--source-summary [boolean] |
Emit compact summary output. | disabled |
--source-meta [boolean] |
Include page metadata. | enabled when source is on |
--source-probe <selectors> |
Comma-separated CSS selectors to probe. | unset |
--source-tree <off|root-only> |
Include compact extension tree details. | unset |
--source-console [boolean] |
Include console summary. | disabled |
--source-dom [boolean] |
Include DOM snapshots/diffs. | enabled when watch-source is on |
--source-max-bytes <bytes> |
Cap output payload size. | unset |
--source-redact <off|safe|strict> |
Redaction strategy for source output. | format-dependent |
--source-include-shadow <off|open-only|all> |
Control Shadow DOM inclusion. | open-only when source is on |
--source-diff [boolean] |
Include diff metadata on watch updates. | enabled when watch-source is on |
| Flag | What it does | Default |
|---|---|---|
--logs <off|error|warn|info|debug|trace|all> |
Minimum log level. | off |
--log-context <list|all> |
Context filter (background, content, page, sidebar, popup, options, devtools). |
all |
--log-format <pretty|json|ndjson> |
Logger output format. | pretty |
--no-log-timestamps |
Disable timestamps in pretty mode. | timestamps enabled |
--no-log-color |
Disable color in pretty mode. | color enabled |
--log-url <pattern> |
Filter log events by URL substring/regex. | unset |
--log-tab <id> |
Filter log events by tab ID. | unset |
Also supports global flags.
--polyfill flag to enable compatibility for the browser.* API in Chromium-based browsers.dev (not start/preview) when you need source inspection options.build.start.extension.config.js.