DOM Inspection
Inspect, query, and optionally interact with the HTML document rendered inside a Cordova/Capacitor WebView.
const options = Ansight.createOptionsBuilder()
.withReadOnlyToolAccess()
.withDomTools({
includeHidden: false,
includeText: true,
includeAttributes: true,
maxDepth: 30,
maxNodes: 1500,
allowActions: false,
})
.build();
DOM tree responses use the shared compact visual-tree v2 contract. HTML tag names are stored in the top-level types registry and referenced by node typeId; DOM ids and supported test attributes can become automationId values.
| Id | Scope | Purpose |
|---|---|---|
dom.get_document | Read | Return the accessible HTML tree, layout bounds, labels, values, and selected attributes. |
dom.inspect_node | Read | Refresh details for one captured DOM node id. |
dom.query_selector | Read | Find up to 200 nodes using a CSS selector. |
dom.invoke_action | Write | Click, focus, blur, or set a supported form value. |
dom.invoke_action is registered only with allowActions: true and still requires write access from the tool guard. DOM text, attributes, and values may contain personal or secret data; tune inclusion and limits accordingly.