Skip to content

feat: expose protocolTimeout as a configurable option #1248

@VidhyaKumar

Description

@VidhyaKumar

Problem

When running lighthouse_audit on heavy pages (e.g. pages with ~5.7MB of third-party scripts), the CDP command Network.emulateNetworkConditions times out with:

Network.emulateNetworkConditions timed out. Increase the 'protocolTimeout' setting in launch/connect calls for a higher timeout if needed.

The current connectOptions in browser.ts don't set protocolTimeout, so Puppeteer's default (180s) is inherited. There's no way for users to increase this.

Proposed Solution

Add --protocolTimeout as a CLI argument / server option, and pass it through to the Puppeteer connect() options:

const connectOptions: Parameters<typeof puppeteer.connect>[0] = {
  targetFilter: makeTargetFilter(enableExtensions),
  defaultViewport: null,
  handleDevToolsAsPage: true,
  protocolTimeout: options.protocolTimeout ?? 180_000,
};

This would allow users to configure it in their MCP server setup:

{
  "command": "npx",
  "args": ["-y", "chrome-devtools-mcp@latest", "--protocolTimeout", "300000"]
}

Context

  • Reproduced on a Magento ecommerce site with 17 third-party vendors (~5.7MB JS)
  • performance_start_trace works fine (no network emulation)
  • lighthouse_audit fails in both navigation and snapshot modes
  • The timeout is on the CDP protocol command itself, not the page load

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions