page.drag
Drag and drop, slide sliders, swipe, reorder lists, pan maps, or draw strokes in a browser via pointer or touch gestures.
Instructions
Press, travel and release like a hand: drag-and-drop, slide a slider or "slide to unlock", reorder a list, pan a map, draw a stroke, or swipe (direction + distance, with touch input on a phone). The pointer approaches the source, presses, holds briefly, moves along a curved slow-fast-slow path with slight wobble, pauses, then releases. Native HTML5 draggable elements are detected and finished with real dragenter/dragover/drop. release:false leaves the press down for page.pointer or another page.drag.
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.drag"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | With y and no locator: start at this viewport point (CSS px). | |
| y | No | ||
| nth | No | Zero-based index when the locator matches several elements. | |
| ref | No | Snapshot ref (eNN) from page.snapshot. | |
| by_x | No | End this many px right of the start (negative: left). The usual way to move a slider. | |
| by_y | No | End this many px below the start (negative: above). | |
| 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. | |
| to_x | No | With to_y: end at this viewport point. | |
| to_y | No | ||
| html5 | No | Default true: detect native draggable and finish with drag events. false: only pointer events. | |
| 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. | |
| steps | No | Intermediate moves. Default one per ~16ms of travel. | |
| xpath | No | XPath expression. | |
| button | No | ||
| to_nth | No | ||
| to_ref | No | Snapshot ref of the drop target. | |
| verify | No | Watch for DOM mutations after the gesture. Default true. | |
| hold_ms | No | Hold still after pressing, before moving. Default 70-180ms human; raise it (500+) for "press and hold to drag" lists. | |
| release | No | Default true. false: keep the button/finger down at the end. | |
| to_text | No | ||
| distance | No | With direction. Default half the viewport. | |
| frame_id | No | Frame to search within; see page.list_frames. | |
| selector | No | CSS selector; pierces shadow DOM. | |
| to_xpath | No | ||
| direction | No | Swipe: the way the finger/pointer moves. Without a start locator it starts at the viewport centre. | |
| 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"]. | |
| settle_ms | No | Hold still at the end before releasing. Default 60-160ms human. | |
| 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. | |
| duration_ms | No | Travel time. Default from distance and target size (Fitts), roughly 250-900ms; a direction swipe defaults to a 150-500ms flick released without a pause. | |
| to_selector | No | Drop on this element (its centre). | |
| backend_node_id | No | CDP backendNodeId, e.g. from inspector.pick. | |
| to_backend_node_id | No |