tv_wait_for
Wait for a UI condition to hold instead of sleeping, with optional stability to avoid half-rendered frames; returns elapsed time and final state.
Instructions
Wait until a condition holds, instead of sleeping. Give exactly one condition. stableMs additionally requires it to keep holding, which avoids acting on a half-rendered frame. Returns the elapsed time and the final state.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | The page's visible text contains this. | |
| scene | No | A visible scene's class contains this (e.g. player). | |
| device | No | Device id from devices.json. Omit to use the default device. | |
| selector | No | A visible element matches this CSS selector. | |
| stableMs | No | Require the condition to hold this long before succeeding (default 0). | |
| focusText | No | Focused element's text contains this (case-insensitive). | |
| timeoutMs | No | Give up after this long (default 15000). | |
| expression | No | ES5 expression that must evaluate truthy. | |
| intervalMs | No | Poll interval (default 250). | |
| selectorGone | No | No visible element matches this CSS selector (spinner gone, popup closed). | |
| videoAdvancing | No | Wait until <video> currentTime is actually moving. |