sincecutoff.com
← all changes

chrome-devtools-mcp page navigation accepts initScript

Introduced 2026-01-29 · score 0.97

HOW TO USE IT

When navigating to a new document, set `initScript` on `navigate_page` to run JavaScript before the page’s other scripts.

navigate_page({"pageId": <pageId>, "type": "url", "url": "<url>", "initScript": "<JavaScript>"})

WHY THIS HELPS

Run setup code on each new document before the page's own scripts during a navigation.

REQUIREMENTS AND LIMITATIONS

  • Version: 0.15.0
  • pageId (required): ID of the target page.
  • initScript: JavaScript executed on each new document before other scripts for the next navigation.
  • type: Navigation action; use `url` to navigate by URL.
  • url: Target URL; required when `type` is `url`.
  • Prerequisite: Use version 0.15.0 or later for this feature.
  • Prerequisite: JavaScript evaluation must be enabled; the `--javascriptEvaluation` option defaults to true, and setting it to false disables `initScript`.
  • Runs on each new document before any other scripts for the next navigation.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card