take_screenshot hangs for 180 s when the Chrome window is minimized (reliable repro for #2459)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- Half a day
- Newbie friendliness
- 64/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- node.js, typescript
- Domain
- tooling
Research direction
Start from the tool handler that issues Page.captureScreenshot and look at how it currently reports protocol failures and timeouts. Before capturing, query the window state with Browser.getWindowForTarget and return the actionable message from the issue when the window is minimized. The issue suggests covering this with a mock handler test since CI is headless, so read the existing screenshot tool tests to see how CDP responses are mocked; done means the minimized case fails immediately with the new message and the existing capture paths still pass.
Written by the indexing model from the issue text.
Description
Description of the bug
When the Chrome window is minimized, take_screenshot never returns. After 180 s it fails with Page.captureScreenshot timed out. Increase the 'protocolTimeout' setting..., and other tools on the page wait behind it.
This looks like the cause of #2459. The repro gist there starts with select_page({bringToFront: true}), which restores the window, so the bug never shows up.
Raw CDP shows the same thing without the MCP (Page.captureScreenshot after Browser.setWindowBounds, 60 s cap):
| Window | Captures hung |
|---|---|
| in front | 0 / 30 |
| covered by another window | 0 / 30 |
| minimized | 30 / 30 |
minimized, Chrome started with --disable-backgrounding-occluded-windows --disable-renderer-backgrounding --disable-background-timer-throttling |
30 / 30 |
Each hung capture finished within 2 s after Page.bringToFront. take_snapshot works fine while minimized. This matches puppeteer#12712: a minimized window renders no frames.
Reproduction
The gist from #2459 with two changes: --browserUrl http://127.0.0.1:9222 instead of --auto-connect, and the window is minimized right after the select_page({pageId: 1, bringToFront: true}) line (I used CDP Browser.setWindowBounds {windowState: "minimized"}; minimizing by hand works too). Each take_screenshot had a 20 s client timeout.
- window normal: 3 / 3 ok (78-525 ms)
- minimized: 3 / 3 timed out
Expectation
take_screenshot fails at once with an actionable error instead of blocking for 180 s. For example: check the window state with Browser.getWindowForTarget before capturing, and if it is minimized, return "The browser window is minimized, so there is nothing to capture. Restore it or call select_page with bringToFront: true." This can be covered by a mock handler test, since CI is headless.
MCP configuration
npx -y chrome-devtools-mcp@latest --browserUrl http://127.0.0.1:9222
Chrome DevTools MCP version
1.13.0
Chrome version
158.0.8127.36
Coding agent version
Claude Code v2.1.331 (also reproduced with @modelcontextprotocol/client 2.4.0)
Model version
No response
Chat log
No response
Node version
v24.14.1
Operating system
Windows Subsystem for Linux (WSL)
Extra checklist
- I want to provide a PR to fix this bug
- Dominant language
- TypeScript
- Stars
- 59.8k
- Forks
- 4.8k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 162
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ChromeDevTools/chrome-devtools-mcp
-
feature
Difficulty 1/5 Under an hour Newbie friendliness 78/100
ChromeDevTools/chrome-devtools-mcp#3689 ·
Maintainers usually reply within 1 day
-
`evaluate_script` `sourcePath` http(s) URLs are mangled into `file://` pathsMay be free again A pull request for this issue was closed without being merged. Opencollecting-feedback
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ChromeDevTools/chrome-devtools-mcp#3453 · 3 comments ·
Maintainers usually reply within 1 day
-
collecting-feedback feature
Difficulty 2/5 Half a day Newbie friendliness 76/100
ChromeDevTools/chrome-devtools-mcp#3225 · 3 comments ·
Maintainers usually reply within 1 day
-
confirmed p3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ChromeDevTools/chrome-devtools-mcp#2947 · 1 comment ·
Maintainers usually reply within 1 day
-
Project Migration: Moving to devtools-frontendPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 5/5 Over a week Newbie friendliness 1/100
ChromeDevTools/chrome-devtools-mcp#3648 ·
Maintainers usually reply within 1 day
All issues in ChromeDevTools/chrome-devtools-mcp
Similar issues
-
bug from-app needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
nightly-labs/openbot#21303 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
ADORSYS-GIS/CoopData#282 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
OHDSI/Data2Evidence#3816 ·
Maintainers usually reply within 3 days
-
`ovsx verify` fails for a version older than the 100 newest of an extensionPossibly taken @trivikr claimed this today. Opencli
Difficulty 2/5 1-3 hours Newbie friendliness 81/100
eclipse-openvsx/openvsx#2482 · 2 comments ·
Maintainers usually reply within 1 day
-
bug builder-vite hmr sev:S3
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
storybookjs/storybook#37965 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day