watch_dom
Observe DOM mutations under a selector to see what an action changed. Install a MutationObserver, then return added/removed nodes or attribute updates; clear the buffer or stop it.
Instructions
Watch DOM mutations (MutationObserver) under selector, to see what an action changed. First call installs the watcher in the page; later calls return the latest mutations (type, tag, attribute, nodes added/removed), clear deletes the ones returned, stop disconnects and empties the buffer. To wait for one element or text use wait_for.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stop | No | Disconnect observer | |
| clear | No | Clear buffer after read | |
| limit | No | Most recent mutations; buffer 1000 | |
| tab_id | No | Target tab; omitted = last tab navigated in this session, else the active one | |
| subtree | No | Observe descendants too, not just the matched node | |
| selector | No | Subtree to observe; ">>>" pierces shadow DOM | body |
| childList | No | Report added and removed children | |
| attributes | No | Report attribute changes | |
| characterData | No | Report text content changes |