Repository navigation
Description
Description of the bug
resize_page is described as resizing "the page's window so that the page has specified dimension". When Chrome clamps the request, for example to its minimum window width, the tool still returns a normal success response and does not mention the page's resulting size. An agent that resizes to test a breakpoint then inspects a page that is wider than it believes.
Actual behavior
Both builds:
resize_page 800x600 -> success (page list only); SIZE -> [800,600]
resize_page 100x100 -> success (page list only); SIZE -> [500,100]
The 100x100 response is identical to the successful 800x600 response.
Reproduction
-
Serve any HTML page from a loopback HTTP server at
http://127.0.0.1:PORT/min.html(for example<!doctype html><title>min</title><h1>Hello</h1>). -
Start the server under test with the flags above and send these
tools/callrequests in order (SIZEstands for() => [innerWidth, innerHeight]):
{"name":"new_page","arguments":{"url":"http://127.0.0.1:PORT/min.html"}}
{"name":"resize_page","arguments":{"pageId":2,"width":800,"height":600}}
{"name":"evaluate_script","arguments":{"pageId":2,"function":"SIZE"}}
{"name":"resize_page","arguments":{"pageId":2,"width":100,"height":100}}
{"name":"evaluate_script","arguments":{"pageId":2,"function":"SIZE"}}The sequence was run once per build with identical results, and again within a longer sequence per build; an earlier independent run on both builds in headless mode, and on the release build in headful (isolated) mode, gave the same kind of result (headful: 100x100 gave 500x232, 20000x20000 gave 20000x1147, both with a success response).
Expectation
resize_page (src/tools/pages.ts:318-357, main build; docs/tool-reference.md, resize_page) promises a page with the specified dimensions. When Chrome cannot produce that size, the response says so, for example by reporting the resulting page size or returning an error, instead of an unqualified success.
MCP configuration
--headless --isolated --no-usage-statistics --no-performance-crux unless the reproduction states otherwise (update checks disabled with CHROME_DEVTOOLS_MCP_NO_UPDATE_CHECKS=1).
Chrome DevTools MCP version
1.10.1 (npm) and main 5ddb0a3 (local build)
Chrome version
154.0.8037.98 (stable)
Node version
v22.23.2
Operating system
macOS 27.0
Environment details
- chrome-devtools-mcp 1.10.1 from npm (the release build).
- chrome-devtools-mcp built from
mainat commit 5ddb0a3 (themainbuild). - Google Chrome 154.0.8037.98 stable, headless; Node v22.23.2; macOS 27.
- Both builds were started with
--headless --isolated --no-usage-statistics --no-performance-cruxandCHROME_DEVTOOLS_MCP_NO_UPDATE_CHECKS=1, and driven by a scripted stdio MCP client.
Evidence
- Expected source:
resize_pagedescription "Resizes the page's window so that the page has specified dimension" insrc/tools/pages.ts:320(mainbuild) anddocs/tool-reference.md. - Failure source: scripted MCP runs above on both builds. The handler calls
page.pptrPage.resize({contentWidth, contentHeight})and then onlyresponse.setIncludePages(true)(src/tools/pages.ts:350-355,mainbuild), without reading back the resulting size. - Evidence provenance: observed
- Local verification: reproduced
- Reproduction completeness: complete
Fix check
With the steps above, the resize_page 100x100 response either reports that the page is 500x100 (or otherwise differs from the request) or is an error. As a control, resize_page 800x600 still returns success for a page that ends up 800x600.
Additional context
The full open and closed issue and PR corpus was screened as of 2026-10-06. Open PR #2784 ("fix: reject non-positive resize_page dimensions") validates 0, negative and non-finite sizes; it does not cover sizes that Chrome accepts but clamps. A related input gap not covered by PR #2784 either: fractional sizes such as 640.5x480.2 return the raw error Protocol error (Browser.setContentsSize): Invalid parameters Failed to deserialize params.width - BINDINGS: int32 value expected on both builds; that is an input-validation question and may fit PR #2784's scope better than this issue. Separately, with an active emulate viewport of 500x400, resize_page 900x700 succeeded and the page stayed 500x400; that response does list the active Emulating viewport line, and the emulation taking precedence may be intended, so it is not part of this report.
Activity
fix(pages): report the actual page size after resize_page (ChromeDevT…
fix(pages): revert reporting the page size after resize_page (ChromeD…
chore(main): release chrome-devtools-mcp 1.12.0 (#3168)
fix(pages): report the size the page actually got after resize_page
OrKoN commentedon Nov 10, 2026
Using layout metrics does not work for backgrounded pages. Please do not send PRs doing that. #3132 was reverted after discovering this.
iyuzhang commentedon Nov 18, 2026
Could we mention in the
resize_pagetool description that Chrome may clamp the requested dimensions even when the call succeeds?docs: clarify that Chrome may clamp resize_page dimensions (ChromeDev…
chore(main): release chrome-devtools-mcp 1.14.0 (ChromeDevTools#3462)