ghost_wait
Wait for UI conditions instead of fixed sleeps: element visibility, value changes, navigation, idle screen, text presence, events, or custom conditions—return immediately when the condition is met.
Instructions
Unified wait - use it instead of sleeping. for=element: an element (name/role) appears or disappears in the target window; returns the moment it does. for=value: an element's VALUE equals/contains/changes (forms, async fields, 'wait until the total updates'). for=navigate: load url in a browser window WITHOUT raising it - sets the address bar over UIA, presses Enter, returns when the window title changes (response: title_before, title_after, title_changed, ms); only a foreground focus policy takes the old focus-and-type path. for=idle: screen stable. for=text: click a target then wait for text. for=event: next foreground change. for=cond: JSONLogic poll. for=ms: a plain sleep - last resort, it costs its full length every run. Target window for element|value|idle|text|navigate = window= or the session anchor.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ms | No | Milliseconds (for=ms) | |
| for | No | What to wait for (default ms) | |
| url | No | URL to navigate to (for=navigate) | |
| name | No | Element name (for=element|value) | |
| role | No | Element role (for=element|value) | |
| text | No | Text to wait for (for=text) or expected value (for=value) | |
| window | No | Window scope (for=idle|element|value|navigate); omit to use the anchor | |
| appears | No | for=element|text: true=wait to appear, false=wait to disappear | |
| condition | No | JSONLogic expression (for=cond) | |
| predicate | No | for=value: how to compare the element's value to text (default equals) | |
| settle_ms | No | for=navigate: pause after the title change so the page can paint (0 = return immediately) | |
| since_seq | No | for=event | |
| timeout_ms | No | ||
| stable_frames | No | for=idle |