webpage_cdp_command
Send a raw DevTools-protocol command to the browser page on a device and return its reply — the escape hatch for capabilities no dedicated tool wraps yet (Emulation, Performance, CSS, Animation, DOM mutation, …). Works on BOTH iOS Safari and Android Chrome, auto-detected from the udid. method is "Domain.command" (e.g. "Emulation.setGeolocationOverride"); params is that command's parameter object. Scope is the BROWSER — this reaches web content only, never the device or native apps. Prefer a dedicated tool when one exists: they handle setup ordering, lifecycle and teardown that a bare command does not. IMPORTANT, iOS: the two engines do NOT implement the same protocol — Android is full CDP, iOS is WebKit's dialect. Chrome-only domains fail with -32601 "domain was not found" (Accessibility, Emulation, and Page.captureScreenshot are all absent on iOS), and a *.enable on iOS reports success without proving the domain exists, so never treat it as a capability probe — probe with a real method.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| udid | Yes | Device UDID / serial (iOS or Android) | |
| method | Yes | Protocol method as "Domain.command", e.g. "Emulation.setDeviceMetricsOverride" | |
| pageId | No | Target page/tab id — auto-picked when omitted | |
| params | No | The command's parameter object; omit for commands that take none | |
| socket | No | Android only: abstract unix socket name (default: chrome_devtools_remote) |