flaky-browser-uilisted
Install: claude install-skill praticoeq-sudo/browser-account-guard
# When the UI will not obey
Automating someone else's web UI fails in three recurring ways: the **tab dies** between
calls, the **framework swallows** your input, or the **control is unreachable** by any
synthetic event. Each has a specific answer, and each has a point where the right move is to
stop and use an API.
> If the page is a signed-in panel belonging to a client or another organisation, run the
> companion skill **`browser-account-guard`** first. Making the UI obey in the wrong account
> is worse than not making it obey at all.
---
## Tabs that die between calls
Symptom: *tab no longer exists*, between one call and the next, repeatedly.
1. **Batching is the default, not an optimization.** A tab survives *within* a batch and dies
*between* batches. Chain navigate → wait → act → capture in one batch.
2. 🔑 **Inside a batch, aim by DOM selector — never by a stored element handle, never by
coordinate.** A handle comes from an earlier page read, and that earlier call is exactly
what dies. A coordinate refers to the screenshot taken *before* the batch, and page scale
shifts between loads. Only a selector resolved *at execution time* survives.
3. **Do not sleep blindly — poll.** There is usually no wait-for-selector. Resolve a
**string or boolean**, never the element: a bridge that serialises the return value turns
a DOM node into `{}`, and you lose the difference between found and timed out.
```js
await new Promise(r => { const t0 = Date.now(