豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

fix(cli): avoid defaulting to isolated when userDataDir is provided#1258

Merged
OrKoN merged 1 commit intoChromeDevTools:mainfrom
pidofme:fix/cli-userdatadir-isolated
Apr 1, 2026
Merged

fix(cli): avoid defaulting to isolated when userDataDir is provided#1258
OrKoN merged 1 commit intoChromeDevTools:mainfrom
pidofme:fix/cli-userdatadir-isolated

Conversation

@pidofme
Copy link
Copy Markdown
Contributor

@pidofme pidofme commented Mar 28, 2026

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

@pidofme pidofme force-pushed the fix/cli-userdatadir-isolated branch from 29c3e7c to 9a1b705 Compare March 30, 2026 10:44
@pidofme pidofme force-pushed the fix/cli-userdatadir-isolated branch from 9a1b705 to a26619e Compare March 31, 2026 12:31
@OrKoN
Copy link
Copy Markdown
Collaborator

OrKoN commented Apr 1, 2026

Thanks!

@OrKoN OrKoN enabled auto-merge April 1, 2026 05:45
@OrKoN OrKoN added this pull request to the merge queue Apr 1, 2026
Merged via the queue into ChromeDevTools:main with commit 73e1e24 Apr 1, 2026
17 checks passed
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants