fix(cli): avoid defaulting to isolated when userDataDir is provided#1258
Merged
OrKoN merged 1 commit intoChromeDevTools:mainfrom Apr 1, 2026
Merged
Conversation
29c3e7c to
9a1b705
Compare
9a1b705 to
a26619e
Compare
OrKoN
approved these changes
Apr 1, 2026
Collaborator
|
Thanks! |
OrKoN
pushed a commit
to mvanhorn/chrome-devtools-mcp
that referenced
this pull request
Apr 1, 2026
…hromeDevTools#1258) ## Summary Fix `chrome-devtools start` so it no longer implicitly enables `isolated` when `--userDataDir` is provided. Previously, the CLI wrapper always defaulted `isolated` to `true` for `start`, which caused `userDataDir` and `isolated` to conflict even when the user only specified `--userDataDir`. This made it impossible to start the CLI daemon against a persistent browser profile. ## Changes - Update `chrome-devtools start` default handling in `src/bin/chrome-devtools.ts` - only default `isolated=true` when `userDataDir` is not set - Clarify the `isolated` CLI description to document the conditional default - Update `docs/cli.md` to reflect that: - `headless` is enabled by default - `isolated` is enabled by default unless `--userDataDir` is provided - Fix a small error message typo ## Why This matches the intended semantics of the flags: - `--isolated` means use a temporary user data dir - `--userDataDir` means use a persistent, explicit user data dir If the user passes `--userDataDir`, the CLI should not also implicitly enable `isolated`. ## Testing - Ran: - `npm test -- tests/cli.test.ts` - `npm test -- tests/e2e/chrome-devtools.test.ts` Added an e2e regression test in `tests/e2e/chrome-devtools.test.ts` to verify that: - `chrome-devtools start --userDataDir <temp dir>` succeeds - the CLI no longer fails with `Arguments userDataDir and isolated are mutually exclusive` - the daemon starts successfully when `userDataDir` is provided
github-merge-queue bot
pushed a commit
that referenced
this pull request
Apr 1, 2026
🤖 I have created a release *beep* *boop* --- ## [0.21.0](chrome-devtools-mcp-v0.20.3...chrome-devtools-mcp-v0.21.0) (2026-04-01) ### 🎉 Features * add a skill for detecting memory leaks using take_memory_snapshot tool ([#1162](#1162)) ([d19a235](d19a235)) ### 🛠️ Fixes * **cli:** avoid defaulting to isolated when userDataDir is provided ([#1258](#1258)) ([73e1e24](73e1e24)) * list_pages should work after selected page is closed ([#1145](#1145)) ([2664455](2664455)) * mark lighthouse and memory as non-read-only ([#1769](#1769)) ([bec9dae](bec9dae)) * **telemetry:** record client name ([9a47b65](9a47b65)) * versioning for Claude Code plugin ([#1233](#1233)) ([966b86f](966b86f)) * wrap .mcp.json config in mcpServers key ([#1246](#1246)) ([c7948cf](c7948cf)) ### 📄 Documentation * Command Code CLI instructions for MCP server ([0a7c0a7](0a7c0a7)) * provide disclaimer about supported browsers ([#1237](#1237)) ([8676b72](8676b72)) ### 🏗️ Refactor * set process titles for easier debugging ([#1770](#1770)) ([0fe3896](0fe3896)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: Alex Rudenko <alexrudenko@chromium.org>
wolfib
pushed a commit
that referenced
this pull request
Apr 1, 2026
🤖 I have created a release *beep* *boop* --- ## [0.21.0](chrome-devtools-mcp-v0.20.3...chrome-devtools-mcp-v0.21.0) (2026-04-01) ### 🎉 Features * add a skill for detecting memory leaks using take_memory_snapshot tool ([#1162](#1162)) ([d19a235](d19a235)) ### 🛠️ Fixes * **cli:** avoid defaulting to isolated when userDataDir is provided ([#1258](#1258)) ([73e1e24](73e1e24)) * list_pages should work after selected page is closed ([#1145](#1145)) ([2664455](2664455)) * mark lighthouse and memory as non-read-only ([#1769](#1769)) ([bec9dae](bec9dae)) * **telemetry:** record client name ([9a47b65](9a47b65)) * versioning for Claude Code plugin ([#1233](#1233)) ([966b86f](966b86f)) * wrap .mcp.json config in mcpServers key ([#1246](#1246)) ([c7948cf](c7948cf)) ### 📄 Documentation * Command Code CLI instructions for MCP server ([0a7c0a7](0a7c0a7)) * provide disclaimer about supported browsers ([#1237](#1237)) ([8676b72](8676b72)) ### 🏗️ Refactor * set process titles for easier debugging ([#1770](#1770)) ([0fe3896](0fe3896)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: Alex Rudenko <alexrudenko@chromium.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix
chrome-devtools startso it no longer implicitly enablesisolatedwhen--userDataDiris provided.Previously, the CLI wrapper always defaulted
isolatedtotrueforstart, which causeduserDataDirandisolatedto conflict even when the user only specified--userDataDir. This made it impossible to start the CLI daemon against a persistent browser profile.Changes
chrome-devtools startdefault handling insrc/bin/chrome-devtools.tsisolated=truewhenuserDataDiris not setisolatedCLI description to document the conditional defaultdocs/cli.mdto reflect that:headlessis enabled by defaultisolatedis enabled by default unless--userDataDiris providedWhy
This matches the intended semantics of the flags:
--isolatedmeans use a temporary user data dir--userDataDirmeans use a persistent, explicit user data dirIf the user passes
--userDataDir, the CLI should not also implicitly enableisolated.Testing
npm test -- tests/cli.test.tsnpm test -- tests/e2e/chrome-devtools.test.tsAdded an e2e regression test in
tests/e2e/chrome-devtools.test.tsto verify that:chrome-devtools start --userDataDir <temp dir>succeedsArguments userDataDir and isolated are mutually exclusiveuserDataDiris provided