Skip to content

Page lists show host/path instead of the document title on main #2937

Description

@coygeek

Description of the bug

On main, the page list printed by list_pages, new_page, navigate_page and other page-listing responses shows Chrome's pre-load placeholder (127.0.0.1:PORT/titled.html) where the document title belongs, and the title field carries the same placeholder. The list does not pick up the real <title> after the page has loaded, nor a title set later by script. The released 1.10.1 package lists the real title. Titles in the page list are a shipped feature (closed #2156, "Include page title in list_pages output"), and agents use them to tell apart pages that share a host. The regression comes from "fix: avoid runtime title fetches (#2883)", which is listed in the pending 1.11.0 release PR #2823.

Actual behavior

main build:

new_page    -> 2: 127.0.0.1:PORT/titled.html (http://127.0.0.1:PORT/titled.html) [selected]
list_pages  -> 2: 127.0.0.1:PORT/titled.html (http://127.0.0.1:PORT/titled.html) [selected]
evaluate_script -> "Changed By Script"
list_pages  -> 2: 127.0.0.1:PORT/titled.html (http://127.0.0.1:PORT/titled.html) [selected]
navigate_page -> 2: 127.0.0.1:PORT/index.html (http://127.0.0.1:PORT/index.html) [selected]
take_snapshot -> uid=1_0 RootWebArea "Index Page" url="http://127.0.0.1:PORT/index.html"
list_pages  -> 2: 127.0.0.1:PORT/index.html (http://127.0.0.1:PORT/index.html) [selected]

Release build, same steps:

new_page    -> 2: Real Title (http://127.0.0.1:PORT/titled.html) [selected]
list_pages  -> 2: Real Title (http://127.0.0.1:PORT/titled.html) [selected]
list_pages  -> 2: Changed By Script (http://127.0.0.1:PORT/titled.html) [selected]
navigate_page -> 2: Index Page (http://127.0.0.1:PORT/index.html) [selected]
list_pages  -> 2: Index Page (http://127.0.0.1:PORT/index.html) [selected]

With --experimentalStructuredContent and only the first two steps, the main build's list_pages structured content was {"id":2,"url":"http://127.0.0.1:PORT/titled.html","title":"127.0.0.1:PORT/titled.html","selected":true}, while the release build's was {"id":2,"url":"http://127.0.0.1:PORT/titled.html","title":"Real Title","selected":true}.

Reproduction

  1. Serve this page from a loopback HTTP server at http://127.0.0.1:PORT/titled.html, and <!doctype html><title>Index Page</title><h1>Index</h1> at /index.html:
<!doctype html><title>Real Title</title><h1>Titled</h1>
  1. Start the server under test with the flags above and send these tools/call requests in order, with a 2-second pause after new_page and a 1-second pause after evaluate_script:
{"name":"new_page","arguments":{"url":"http://127.0.0.1:PORT/titled.html"}}
{"name":"list_pages","arguments":{}}
{"name":"evaluate_script","arguments":{"pageId":2,"function":"() => { document.title = 'Changed By Script'; return document.title; }"}}
{"name":"list_pages","arguments":{}}
{"name":"navigate_page","arguments":{"pageId":2,"url":"http://127.0.0.1:PORT/index.html"}}
{"name":"take_snapshot","arguments":{"pageId":2}}
{"name":"list_pages","arguments":{}}

The sequence was run once per build; the separate investigations that first found this reported the same result in several other step sequences on the main build.

Expectation

Each page line has the form <id>: <document title> (<url>), and the structured page entry's title is the document's title, as delivered for #2156 and as the release build does. A title changed by script or by a navigation is reflected in the next page list.

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 main at commit 5ddb0a3 (the main build; its --version still prints 1.10.1).
  • 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-crux and CHROME_DEVTOOLS_MCP_NO_UPDATE_CHECKS=1, and driven by a scripted stdio MCP client.

Evidence

  • Expected source: closed Include page title in list_pages output #2156 ("Include page title in list_pages output"), whose requested format ${id}: ${title} (${url}) is what the release build prints; the page-line code in src/McpResponse.ts:1068 and src/McpResponse.ts:1090 on the main build still formats title (url) when a title is present.
  • Failure source: scripted MCP runs above on the main build, with the release build as the control. On the main build, McpPage.getTitle() (src/McpPage.ts:218-222) returns the cached target._getTargetInfo().title; commit 04195d1 (fix: avoid runtime title fetches #2883) replaced the previous page.title() lookup with it, and the same commit's test snapshot updates changed an expected 1: My test page (about:blank) line to 1: about:blank.
  • Evidence provenance: observed
  • Local verification: reproduced
  • Reproduction completeness: complete

Text and structured content were observed on both builds for this report.

Fix check

With the steps above, the main build's first list_pages prints 2: Real Title (http://127.0.0.1:PORT/titled.html), the list after the script prints Changed By Script, the list after the navigation prints Index Page, and the structured title field matches each time. As a control, a page without a <title> still prints only its URL, and list_pages stays fast when a page is loading or showing a dialog (an earlier run in this investigation measured the release build spending about 1 s per such page on its title lookup, the cost #2883 removed).

Additional context

The full open and closed issue and PR corpus was screened as of 2026-10-06. Closed #2156 delivered the feature; closed PR #2775 ("fix: avoid cumulative page title timeouts") was closed in favour of #2883. No open issue reports the regression.

Introducing change: #2883 ("fix: avoid runtime title fetches"). The earlier refactor 545cbe3 (#2812) added the cached target-info title only as a fallback for pages that were not yet initialized; with #2812 alone, initialized pages still used page.title().

A discriminating check with the Puppeteer version bundled by the main build (25.12.0) against the same Chrome: after loading titled.html, Target.getTargets on a browser CDP session returned "Real Title" and page.title() returned "Real Title", while the page target's cached _getTargetInfo().title was still "127.0.0.1:PORT/titled.html"; after a script set document.title, Target.getTargets returned "Changed By Script" and the cached value was unchanged. Chrome therefore reports the right title over CDP, and only the cached copy the page list reads is stale.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions