Skip to content

CDP / Extension Escape Hatch

When DevBridge's 25 standard tools don't cover your use case, six escape-hatch tools let you reach directly into Chrome DevTools Protocol (CDP) or call chrome.* extension APIs.

Use standard tools first

The escape-hatch tools are powerful but lower-level. Prefer dedicated tools like screenshot, computer, read_console, and read_network — they include built-in error handling, permission checks, and retry logic. Only reach for the escape hatch when a standard tool genuinely can't cover the need.

CDP tools

cdp_command — Send a single CDP command

Send any Chrome DevTools Protocol command and get the response. Best for one-shot request/response operations.

Introspection with _help: Pass method: "_help" to list all available CDP domains. Pass method: "Network._help" to see all commands in the Network domain along with their parameter descriptions.

json
// List all CDP domains
{ "method": "_help" }

// See commands in the Network domain
{ "method": "Network._help" }

// Emulate a device (iPhone 14)
{
  "method": "Emulation.setDeviceMetricsOverride",
  "params": {
    "width": 390,
    "height": 844,
    "deviceScaleFactor": 3,
    "mobile": true
  }
}

// Emulate 3G network conditions
{
  "method": "Network.emulateNetworkConditions",
  "params": {
    "offline": false,
    "downloadThroughput": 375000,
    "uploadThroughput": 125000,
    "latency": 100
  }
}

cdp_subscribe — Subscribe to CDP events

Subscribe to a CDP event stream. Set untilPredicate to stop automatically when a condition is met, avoiding open-ended waits.

json
// Wait for a specific network request to complete
{
  "tabId": 123,
  "eventName": "Network.responseReceived",
  "untilPredicate": "event.response.url.includes('/api/data')",
  "timeoutMs": 10000
}

cdp_events_read — Pull CDP events from the ring buffer

Pull already-captured CDP events without needing a prior subscription. Useful for after-the-fact analysis.

json
{
  "tabId": 123,
  "eventName": "Network.requestWillBeSent",
  "limit": 50
}

chrome.* extension tools

extension_call — Call a chrome.* API method

Call whitelisted chrome.* API methods. For void methods, the response is { success: true, void: true }.

Supported namespaces: chrome.storage, chrome.cookies, chrome.tabs, chrome.windows, chrome.bookmarks, chrome.history, chrome.downloads, and others declared in the extension manifest permissions.

json
// Read from local storage
{
  "namespace": "storage.local",
  "method": "get",
  "args": [["myKey"]]
}

// Get all cookies for a domain
{
  "namespace": "cookies",
  "method": "getAll",
  "args": [{ "domain": "example.com" }]
}

Pass method: "_help" to list callable methods for a namespace:

json
{ "namespace": "storage.local", "method": "_help" }

extension_subscribe — Subscribe to chrome.* events

Subscribe to chrome.* events, similar in usage to cdp_subscribe.

json
{
  "namespace": "tabs",
  "eventName": "onUpdated",
  "untilPredicate": "event.changeInfo.status === 'complete'",
  "timeoutMs": 15000
}

extension_events_read — Pull chrome.* events from the ring buffer

Pull already-captured chrome.* events from the ring buffer.

json
{
  "namespace": "tabs",
  "eventName": "onUpdated",
  "limit": 20
}

Subscribe vs pull mode

ScenarioRecommended tool
Wait for an event before continuingcdp_subscribe / extension_subscribe (with untilPredicate)
Review what events already happenedcdp_events_read / extension_events_read
Send a command and get a resultcdp_command / extension_call

Common use cases

  • Emulate a mobile device or network conditionscdp_command + Emulation.* / Network.emulateNetworkConditions
  • Read or write extension local storageextension_call + storage.local.get / set
  • Wait for SPA navigation to finishcdp_subscribe + Page.frameNavigated
  • Audit full headers of specific requestscdp_events_read + Network.requestWillBeSent
  • Monitor cookie changesextension_subscribe + cookies.onChanged

DevBridge — Browser Debugging & Automation via MCP