wait_for
Poll browser until a CSS selector, text, or JavaScript predicate meets a condition, then return. Fails with last observed state on timeout.
Instructions
Poll until a condition holds, then return. Fails with what it last saw.
Args: selector: CSS selector to watch. state: 'visible', 'hidden', 'present', 'absent', 'enabled', or 'text' (with the text argument). text: Substring to look for when state is 'text'. predicate: A JavaScript expression to poll instead of a selector, e.g. "document.readyState === 'complete'". tab_id: Exact tab id. url_pattern: Regex matched against tab URLs. timeout_ms: How long to keep polling. poll_ms: Interval between checks, minimum 50.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | ||
| state | No | visible | |
| tab_id | No | ||
| poll_ms | No | ||
| selector | No | ||
| predicate | No | ||
| timeout_ms | No | ||
| url_pattern | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |