page.pinch
Simulates a two-finger pinch and twist gesture to zoom or rotate maps, image viewers, and canvases; enable touch emulation first so the page responds as a touch device.
Instructions
Two-finger touch gesture: pinch to zoom (scale over 1 spreads the fingers, under 1 pinches them together) and/or twist (rotate_deg). For maps, image viewers, canvases and anything reading multi-touch. Turn on touch emulation first (device.preset) so the page treats it as a touch device.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "page.pinch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | With y: centre of the gesture. Default the element centre, else the viewport centre. | |
| y | No | ||
| nth | No | Zero-based index when the locator matches several elements. | |
| ref | No | Snapshot ref (eNN) from page.snapshot. | |
| seed | No | Seed for the human randomness, to repeat a gesture exactly. Every call reports the seed it used. | |
| text | No | Visible text of the element. | |
| human | No | Default true: curved path, slow-fast-slow speed, hand jitter, short pauses. false: straight, even, no pauses. | |
| input | No | Default auto: touch when touch emulation is on for the tab (device.preset), else mouse. | |
| scale | No | Final finger spread / starting spread. 2 = zoom in, 0.5 = zoom out. | |
| xpath | No | XPath expression. | |
| verify | No | Watch for DOM mutations after the gesture. Default true. | |
| frame_id | No | Frame to search within; see page.list_frames. | |
| selector | No | CSS selector; pierces shadow DOM. | |
| angle_deg | No | Starting angle of the line between the fingers. Default 0 (side by side). | |
| jitter_px | No | Hand wobble mid-path in CSS px. Default 1.5; 0 for a steady hand. Ends are always exact. | |
| modifiers | No | Keys held throughout, e.g. ["Shift"] or ["Alt"]. | |
| target_id | No | Target handle (tgt_*). Omit for the active page. | |
| verify_ms | No | How long to watch. Default 300. | |
| browser_id | No | Browser handle (br_*). Omit to use the only running browser, or auto-launch one. | |
| rotate_deg | No | Twist the fingers by this many degrees, clockwise positive. | |
| duration_ms | No | Default 450. | |
| start_distance | No | Starting gap between the fingers in CSS px. Default 120. | |
| backend_node_id | No | CDP backendNodeId, e.g. from inspector.pick. |