You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add --skipUnresponsiveTabs flag for connecting to browsers with many tabs
When connecting to a running browser via --browserUrl, browser.pages()
hangs indefinitely if any tab is unresponsive (discarded by memory
management, dead localhost, etc). This blocks all tool calls since page
enumeration runs on every request.
Add a new --skipUnresponsiveTabs CLI flag (default: false). When enabled:
1. Sets protocolTimeout (15s) on puppeteer.connect() so CDP commands
fail with an error instead of hanging forever.
2. Wraps browser.pages() in #getAllPages() with a 10s timeout. If it
fails, falls back to per-target enumeration: iterates
browser.targets(), calls target.page() on each with a 5s timeout,
and skips tabs that don't respond.
When the flag is off, behavior is identical to before.
Tested with Chrome/Brave 145, 28 open tabs (5 discarded). Without this
flag the server hangs forever on the first tool call. With the flag it
returns 23 responsive pages in ~12s and logs the 5 it skipped.
Related: puppeteer/puppeteer#5633, puppeteer/puppeteer#14708, #870, #978
When connecting to an existing browser, skip tabs that don't respond to CDP commands (e.g. discarded or sleeping tabs) instead of hanging. Recommended when using --browserUrl with many open tabs.
Whether to enable coordinate-based tools such as click_at(x,y). Usually requires a computer-use model able to produce accurate coordinates by looking at screenshots.
565
570
-**Type:** boolean
@@ -725,6 +730,8 @@ trace.
725
730
726
731
You can connect to a running Chrome instance by using the `--browser-url` option. This is useful if you are running the MCP server in a sandboxed environment that does not allow starting a new Chrome instance.
727
732
733
+
If you have many tabs open, some may be discarded by the browser to save memory. These tabs don't respond to CDP commands, which can cause the MCP server to hang on startup. Use `--skip-unresponsive-tabs` to skip these tabs instead of blocking.
734
+
728
735
Here is a step-by-step guide on how to connect to a running Chrome instance:
Copy file name to clipboardExpand all lines: src/bin/chrome-devtools-mcp-cli-options.ts
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -147,6 +147,11 @@ export const cliOptions = {
147
147
type: 'boolean',
148
148
description: `If enabled, ignores errors relative to self-signed and expired certificates. Use with caution.`,
149
149
},
150
+
skipUnresponsiveTabs: {
151
+
type: 'boolean',
152
+
description: `When connecting to an existing browser, skip tabs that don't respond to CDP commands (e.g. discarded or sleeping tabs) instead of hanging. Recommended when using --browserUrl with many open tabs.`,
0 commit comments