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.

IdScopePurpose
dom.get_documentReadReturn the accessible HTML tree, layout bounds, labels, values, and selected attributes.
dom.inspect_nodeReadRefresh details for one captured DOM node id.
dom.query_selectorReadFind up to 200 nodes using a CSS selector.
dom.invoke_actionWriteClick, 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.