Description of the bug
Bug: navigate_page timeout parameter is not respected by WaitForHelper
Description
The navigate_page tool accepts a timeout parameter, but the actual navigation timeout is hardcoded to 3000 * networkTimeoutMultiplier ms in WaitForHelper.js. The user-provided timeout value is not passed to the internal waitForNavigation call.
Steps to Reproduce
- Call
navigate_page with a custom timeout:
{
"type": "url",
"url": "https://example.com",
"timeout": 30000
}
- Observe the logs:
navigate_page request: {
"type": "url",
"url": "https://example.com",
"timeout": 30000
}
navigate_page context: resolved
Detecting open DevTools windows
TimeoutError: Navigation timeout of 3000 ms exceeded
Expected Behavior
The navigation should wait for 30000ms (as specified in the request) before timing out.
Actual Behavior
The navigation times out after 3000ms, ignoring the user-provided timeout parameter.
Root Cause Analysis
In WaitForHelper.js:
// Line 14-18: Constructor sets fixed timeout
constructor(page, cpuTimeoutMultiplier, networkTimeoutMultiplier) {
this.#navigationTimeout = 3000 * networkTimeoutMultiplier; // ← Fixed value
// ...
}
// Line 109-112: waitForEventsAfterAction uses the fixed timeout
return this.#page.waitForNavigation({
timeout: this.#navigationTimeout, // ← Uses fixed value, ignores user input
signal: this.#abortController.signal,
});
In pages.js, the navigate_page handler:
// Line 129: User timeout is passed to options
const options = {
timeout: request.params.timeout,
};
// Line 164: page.goto receives the options
await page.goto(request.params.url, options);
However, context.waitForEventsAfterAction() wraps the navigation and calls waitForNavigation with its own fixed timeout, which overrides the user's setting.
Suggested Fix
Pass the timeout parameter from the request to WaitForHelper:
// In McpContext.js or pages.js
async waitForEventsAfterAction(action, options = {}) {
const timeout = options.timeout ?? this.#navigationTimeout;
// Use this timeout in waitForNavigation
}
Or modify WaitForHelper constructor/method to accept a timeout override.
Environment
- chrome-devtools-mcp version: 0.15.0
- OS: macOS
- Node.js version: 20.x
Related Issues
Thank you for the great tool! 🙏
Reproduction
No response
Expectation
No response
MCP configuration
No response
Chrome DevTools MCP version
0.15.0
Chrome version
No response
Coding agent version
No response
Model version
No response
Chat log
No response
Node version
No response
Operating system
None
Extra checklist
Description of the bug
Bug:
navigate_pagetimeout parameter is not respected byWaitForHelperDescription
The
navigate_pagetool accepts atimeoutparameter, but the actual navigation timeout is hardcoded to3000 * networkTimeoutMultiplierms inWaitForHelper.js. The user-provided timeout value is not passed to the internalwaitForNavigationcall.Steps to Reproduce
navigate_pagewith a custom timeout:{ "type": "url", "url": "https://example.com", "timeout": 30000 }Expected Behavior
The navigation should wait for 30000ms (as specified in the request) before timing out.
Actual Behavior
The navigation times out after 3000ms, ignoring the user-provided
timeoutparameter.Root Cause Analysis
In
WaitForHelper.js:In
pages.js, thenavigate_pagehandler:However,
context.waitForEventsAfterAction()wraps the navigation and callswaitForNavigationwith its own fixed timeout, which overrides the user's setting.Suggested Fix
Pass the timeout parameter from the request to
WaitForHelper:Or modify
WaitForHelperconstructor/method to accept a timeout override.Environment
Related Issues
wait_forThank you for the great tool! 🙏
Reproduction
No response
Expectation
No response
MCP configuration
No response
Chrome DevTools MCP version
0.15.0
Chrome version
No response
Coding agent version
No response
Model version
No response
Chat log
No response
Node version
No response
Operating system
None
Extra checklist