Skip to content

resize_page reports an out-of-date page size when the target page is a background tab #3306

Description

@OrKoN

Description of the bug

resize_page resizes the browser window correctly. But when the target page
is not the front tab, the tool adds a wrong line to the response:

Requested 1100x750, page is 1504x836

The window and the front tab are 1100x750. The target tab shows 1100x750 only
after it comes to the front.

Cause: since #3132, McpPage.resize() reads Page.getLayoutMetrics from the
target page right after the resize
(src/McpPage.ts#L1442-L1479).
Chrome does not lay out a background tab again until the tab is visible. Thus
the metrics show the old size. With page ID routing (default true), a page
tool does not bring its page to the front.

An agent that reads this line can think that the resize failed, and can try
again or take a wrong action. Before #3132, the tool did not print a size.

Reproduction

  1. new_page with {"url": "http://localhost:8787/"}. This is page 2.
  2. new_page with {"url": "https://developer.chrome.com/docs/devtools"}.
    This is page 3. Page 3 is now the front tab.
  3. resize_page with {"pageId": 2, "width": 1100, "height": 750}.
    Result: Requested 1100x750, page is 1504x836.
  4. evaluate_script on page 3 with () => [innerWidth, innerHeight].
    Result: [1100, 750].
  5. evaluate_script on page 2 with the same function. Result: [1504, 836].
  6. select_page with {"pageId": 2, "bringToFront": true}.
  7. evaluate_script on page 2 again. Result: [1100, 750].

When the target page is the front tab, the tool prints no mismatch line.

Expectation

The tool does not print a mismatch line when the window was resized
correctly. Possible fixes:

  • Bring the target page to the front before the resize.
  • Or skip the size check (or say that the size is unknown) when the target
    page is not the front tab.

MCP configuration

{
  "command": "node",
  "args": [
    "/path/to/chrome-devtools-mcp/build/src/bin/chrome-devtools-mcp.js",
    "--memoryDebugging", "--categoryExperimentalWebmcp",
    "--categoryExperimentalThirdParty", "--categoryExtensions",
    "--categoryPwa", "--experimentalVision"
  ]
}

The extra flags do not change resize_page behavior.

Chrome DevTools MCP version

main at f4eaf1f (1.11.0 + 126 commits, release candidate). Regression from #3132.

Chrome version

156.0.8078.48 (stable)

Coding agent version

Antigravity, direct MCP tool calls

Model version

Not relevant (the tool calls are deterministic)

Chat log

N/A

Node version

v24.21.0

Operating system

macOS

Activity

  1. self-assigned this
    on Oct 22, 2026
  2. added theissue type on Oct 22, 2026
  3. added a commit that references this issue on Oct 22, 2026
    186ea66
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions