wait_for
Wait for a page condition (element, text, function, navigation, or network idle) with configurable timeout and visibility, returning found:false on timeout instead of throwing.
Instructions
Block until a condition holds: element, text, function (JS expression; needs the "Allow user scripts" toggle), navigation (mode=spa for client-side routes), network_idle. Polls until timeout (10s element/function, 15s the rest) then returns found: false with a reason instead of raising: check it, or a failed wait reads as success. Read-only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | spa = pushState/popstate/hashchange | load |
| text | No | Literal text to wait for (condition=text), matched case-insensitively | |
| tab_id | No | Target tab; omitted = last tab navigated in this session, else the active one | |
| idle_ms | No | Quiet period ms (network_idle) | |
| timeout | No | Max ms (default 10000; 15000 navigation/network_idle) | |
| visible | No | Element must also be visible | |
| frame_id | No | Target iframe id from get_frames; omitted = main frame | |
| interval | No | Poll ms, min 50 | |
| selector | No | condition=element; with condition=text it narrows the search to that subtree | |
| condition | Yes | element and text need selector or text; function needs expression | |
| expression | No | JS expression (condition=function) |