Click
operagx_clickClicks like a human in Opera GX via CDP, firing native events. Target by element ID, CSS selector, or x/y coordinates, with button and click count options.
Instructions
Clicks a real point in the browser via CDP mouse input (Input.dispatchMouseEvent), not a JS-level element.click(), so native behaviors (custom canvas controls, drag handles, popups, focus/blur listeners) fire exactly as they would for a human click.
Args:
tabId / tabIndex / matchUrl / matchTitle (optional): which tab to click in.
elementId (number, optional): id from the last operagx_map_elements call. Preferred.
selector (string, optional): CSS selector, if not using elementId.
x / y (number, optional): absolute viewport coordinates, if not using elementId/selector.
button ('left' | 'right' | 'middle', default 'left').
clickCount (number, default 1): 2 for double-click, 3 for triple-click.
Exactly one of elementId, selector, or x+y must be given.
Returns: { "ok": true, "clickedAt": { "x": number, "y": number, "selector"?: string } }
Examples:
Use when: "click the Submit button" -> map_elements first for its elementId, then click it.
Use when: a canvas-drawn control has no DOM selector -> click with explicit x/y from a screenshot's pixel coordinates.
Don't use when: you need to type into a field afterward and haven't focused it yet — use operagx_type_text instead, which clicks and types in one call.
Error Handling:
Returns "elementId N is not in the current map..." if the id is stale — call operagx_map_elements again.
Returns "Provide one of: elementId, selector, or x/y." if no target was given.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | Absolute viewport x in CSS pixels, if not using elementId/selector. | |
| y | No | Absolute viewport y in CSS pixels, if not using elementId/selector. | |
| tabId | No | Tab id from operagx_list_tabs. Omit to use the first open tab. | |
| button | No | left | |
| matchUrl | No | Pick the tab whose URL contains this substring. | |
| selector | No | CSS selector, if not using elementId. | |
| tabIndex | No | Zero-based tab index, alternative to tabId. | |
| elementId | No | Id from the last operagx_map_elements call (preferred — most robust). | |
| clickCount | No | 2 for double-click, 3 for triple-click. | |
| matchTitle | No | Pick the tab whose title contains this substring. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| clickedAt | Yes |