← Back to Input domain

Input.dispatchDragEvent

Dispatches a drag event into the page.

Domain: Input experimental

Parameters

NameTypeDescription
typestringType of the drag event.
xnumberX coordinate of the event relative to the main frame's viewport in CSS pixels.
ynumberY coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport.
dataDragData
modifiers (optional)integerBit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).

Example Request

{
  "id": 1,
  "method": "Input.dispatchDragEvent",
  "params": {
    "type": "type-value",
    "x": 100,
    "y": 100,
    "data": "data-value"
  }
}

Example Response

{
  "id": 1,
  "result": {}
}

Usage in Node.js

const result = await send('Input.dispatchDragEvent', {"type": "type-value", "x": 100, "y": 100, "data": "data-value"});
console.log(result);