Wait For Selector
operagx_wait_forWaits for a CSS selector to reach a specified state (attached, visible, hidden, or detached) within a timeout, enabling synchronization with page changes like waiting for a spinner to disappear.
Instructions
Waits until a selector reaches a given state, or times out.
Args:
tabId / tabIndex / matchUrl / matchTitle (optional): which tab.
selector (string): CSS selector to wait for.
state ('attached' | 'visible' | 'hidden' | 'detached', default 'visible').
timeoutMs (number, default 10000).
Returns: { "ok": true }
Examples:
Use when: "wait for the spinner to disappear before continuing" -> wait_for with the spinner's selector and state="hidden".
Error Handling:
Throws a timeout error naming the selector and state if it isn't reached in time.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| state | No | visible | |
| tabId | No | Tab id from operagx_list_tabs. Omit to use the first open tab. | |
| matchUrl | No | Pick the tab whose URL contains this substring. | |
| selector | Yes | ||
| tabIndex | No | Zero-based tab index, alternative to tabId. | |
| timeoutMs | No | ||
| matchTitle | No | Pick the tab whose title contains this substring. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes |