Skip to content

search_dom returns attributes but not text content #516

Open

Description

Summary

search_dom's output schema is {tag, nodeId, backendNodeId, attributes} (src/browser/dom.ts:79-87) — no text content. An agent can locate an element (e.g. a <script type="application/json" id="..."> by id/selector) but then has no way to read what's inside it.

Current workarounds and their cost

  • get_dom: writes the entire document's outerHTML to a temp file (src/browser/dom.ts:40-49) — works, but is a whole-document read for a single element's text.
  • evaluate_script: works, but requires the agent to write and run arbitrary JS just to read .textContent.

Proposal

An opt-in includeText (or similar) parameter on search_dom that adds each matched node's textContent to the result. Closes the loop cheaply for the common case of "I found the right element, now let me read it" without a full-document dump.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions