Wait for the page
surfsky_waitWait for a page to meet a condition (selector, text, URL, or time), then return its URL and title. Use after actions or navigation when content loads dynamically.
Instructions
Wait until the active tab meets a condition, then return its url and title. Use it for content that loads after an action or after a domcontentloaded navigation; actions already settle on their own, so no wait is needed after every step. Conditions: selector present (or gone), url_contains, text on the page, seconds; when several are given they are waited one after another, each with the full timeout. For elements that do not exist yet use a CSS selector: @N and text=words must resolve now. A condition not met in time fails with a timeout error and the page is left as it is. For a condition only script can check, use surfsky_evaluate with an async function that polls.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gone | No | With selector: wait until it is absent or has no layout box, instead of present. | |
| text | No | String the page's visible text must contain. | |
| seconds | No | Fixed sleep in seconds, after the other conditions. | |
| timeout | No | Seconds allowed per condition (default 30). | |
| selector | No | Element to wait for: a CSS selector (works for elements that do not exist yet), @N, or text=words. | |
| session_id | No | Session from surfsky_session_start. Omit for the shared default session, started on first use. | |
| url_contains | No | Substring the page URL must contain. |