Repository navigation
feat: support passing args to Chrome - #338
Merged
Merged
Conversation
OrKoN
force-pushed
the
orkon/chrome-args
branch
2 times, most recently
from
October 10, 2025 14:41
293bd38 to
ae9d695
Compare
jackfranklin
approved these changes
Oct 10, 2025
OrKoN
force-pushed
the
orkon/chrome-args
branch
from
October 10, 2025 15:01
ae9d695 to
e96f34d
Compare
OrKoN
enabled auto-merge (squash)
October 10, 2025 15:01
OrKoN
pushed a commit
that referenced
this pull request
Oct 10, 2025
🤖 I have created a release *beep* *boop* --- ## [0.8.0](chrome-devtools-mcp-v0.7.1...chrome-devtools-mcp-v0.8.0) (2025-10-10) ### Features * support passing args to Chrome ([#338](#338)) ([e1b5363](e1b5363)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
AlinaVarkki
pushed a commit
that referenced
this pull request
Oct 13, 2025
Drive-by: removes custom devtools frontend as a dedicated argument. Closes #261
AlinaVarkki
pushed a commit
that referenced
this pull request
Oct 13, 2025
🤖 I have created a release *beep* *boop* --- ## [0.8.0](chrome-devtools-mcp-v0.7.1...chrome-devtools-mcp-v0.8.0) (2025-10-10) ### Features * support passing args to Chrome ([#338](#338)) ([e1b5363](e1b5363)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
franco-bianco
pushed a commit
to franco-bianco/ghostframe-mcp
that referenced
this pull request
May 2, 2026
🤖 I have created a release *beep* *boop* --- ## [0.8.0](ChromeDevTools/chrome-devtools-mcp@chrome-devtools-mcp-v0.7.1...chrome-devtools-mcp-v0.8.0) (2025-10-10) ### Features * support passing args to Chrome ([#338](ChromeDevTools/chrome-devtools-mcp#338)) ([0b75746](ChromeDevTools/chrome-devtools-mcp@0b75746)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
eacp1991
pushed a commit
to eacp1991/chrome-devtools-mcp
that referenced
this pull request
Sep 15, 2026
…s#2634) Follow-up to ChromeDevTools#261. That issue was closed by ChromeDevTools#338, which added `--chrome-arg` so the sandbox can be disabled explicitly. The flag works, but the failure it fixes is still undiscoverable — you cannot find out that `--chrome-arg=--no-sandbox` is the answer. ### Problem `launch()` uses `pipe: true`. In pipe mode Puppeteer never calls `waitForLineOutput()`, which is the only place Chrome's stderr makes it into the thrown error. So when Chrome exits at startup with ``` Running as root without --no-sandbox is not supported. See https://crbug.com/638180. ``` that line is dropped, and what reaches the MCP client is: ``` Protocol error (Target.setDiscoverTargets): Target closed ``` Reproduced on `main` (v1.8.0) by pointing `executablePath` at a stub that prints Chrome's message to stderr and exits 1 — exactly the symptom reported in ChromeDevTools#261. The `catch` in `launch()` only recognised `The browser is already running`. ### Fix Detect the case and rethrow with an explanation. Deliberately **not** disabling the sandbox automatically, per ChromeDevTools#261 (comment): ``` Chrome failed to start: Protocol error (Target.setDiscoverTargets): Target closed chrome-devtools-mcp is running as root and Chrome does not start as root unless its sandbox is disabled (https://crbug.com/638180). Prefer running chrome-devtools-mcp as a non-root user. If that is not possible, for example in a container, pass --chrome-arg=--no-sandbox. That disables the Chrome sandbox, so only do it for content you trust. ``` Notes on the shape of the check: - It runs **only on a failed launch**, so root with a properly installed setuid sandbox is unaffected. - The original error is kept in the message and as `cause`, so an unrelated failure under root is never masked or mislabelled. - `--no-sandbox` present in the args short-circuits it: root is then not what stopped Chrome. - `--disable-setuid-sandbox` and `--no-sandbox-and-elevated` do **not** count as opting out — Chrome's zygote check requires `--no-sandbox` specifically. Covered by a test. - On Windows `process.getuid` is undefined, so the check is a no-op. Also adds a "Running as root" section to `docs/troubleshooting.md`, next to the existing "Operating system sandboxes". ### Testing Five unit tests in `tests/browser.test.ts` covering root / non-root / no-uid platforms, the already-opted-out args, and the near-miss args above. The pre-existing integration tests in that file cannot run in my environment — Chrome reports `No usable sandbox! ... AppArmor userns restrictions` there, on a clean checkout as well as with this change.
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.
Drive-by: removes custom devtools frontend as a dedicated argument.
Closes #261