DocsWorkflowsComponentsMachinemachine:extension:observe

machine:extension:observe

Reads the live page through the connected browser extension and returns its interactive elements as refs a model can name. It is the eye of the authoring loop, and it is useful on its own when a workflow needs to branch on what a page is currently showing.

Options

NameTypeDescription
urlstringThe page to open before observing; empty observes whatever the matched tab already shows
match_urlstringA substring an open tab's URL must contain for the observation to reuse that tab
client_idstringThe extension client to observe through, a hint the host may honour; empty leaves the choice of browser to the host
scopestringA CSS selector narrowing the observation to one region of the page
max_nodesintHow many interactive elements to keep (default 200)
timeout_msintHow long to wait for the browser before failing (default 10 minutes)

Outputs

NameTypeDescription
observationPageObservationThe structured snapshot of the page's interactive elements
  ↳ urlstringIs the observed page's address.
  ↳ titlestringIs the document title.
  ↳ nodes[]ObservedNodeAre the interactive elements, in document order.
    ↳ refstringIs the short handle for this node ("e1", "e2"), unique inside one observation and meaningless outside it.
    ↳ rolestringIs the aria role, explicit or implied by the tag.
    ↳ namestringIs the accessible name, from aria-label, an associated label, the text, the placeholder, the title, or the alt text.
    ↳ tagstringIs the lowercase tag name.
    ↳ typestringIs the input type, for form controls that carry one.
    ↳ valuestringIs the current value, capped by the observer and never set for a password input.
    ↳ placeholderstringIs the control's placeholder text.
    ↳ disabledboolReports whether the control rejects interaction.
    ↳ checkedboolIs the state of a checkbox or radio.
    ↳ expandedboolMirrors aria-expanded.
    ↳ options[]stringAre a select's option values, capped by the observer.
    ↳ selectorstringIs the stable CSS selector the observer built for this node, the same one the element picker would produce.
    ↳ pathstringIs the structural path, for a node CSS cannot address.
    ↳ indexes[]intNarrows a multi-match selector to this node's positions.
    ↳ enter[]stringMirrors Selector.Enter, the shadow hosts and frames to descend through before Selector resolves. Absent for an element in the top document, which is most of them.
    ↳ sectionstringNames the nearest enclosing landmark or the preceding heading, so a reader can tell two identical controls apart by where they sit.
    ↳ contextstringIs the text of the row, card or list item the element sits in, filled in only when the element's own name does not already say which one this is. It is what tells twenty identical add-to-cart buttons apart.
    ↳ offscreenboolMarks an element laid out outside the current viewport. It is still real and still actionable, since the engine scrolls to it.
    ↳ obscuredboolMarks an element another element covers at its center point, which is what a cookie wall or an open dialog does to the page behind it.
    ↳ similarintCounts the further siblings left out because they repeat this one's shape. It sits on the last member of a collapsed run.
  ↳ headings[]ObservedHeadingAre the page's headings, in document order.
    ↳ levelintIs the heading level, 1 for h1.
    ↳ textstringIs the heading's text.
  ↳ textstringIs the readable page text, present only when the observation asked for it, capped by the observer.
  ↳ truncatedboolReports that the node or text cap clipped the page, so a reader knows the snapshot is partial.
  ↳ modalstringNames the dialog or consent wall standing over the page, when one is. Everything outside it is marked obscured, because clicking it is what a browser would refuse to do until the wall is dealt with.
  ↳ modal_frameboolSays the wall is a cross-origin frame, which is how most consent managers ship. Nothing inside one can be listed or clicked from the page it covers, so getting past it needs another way in rather than a ref from this snapshot.
  ↳ omittedintCounts the elements the caps and the repeat collapsing left out.
  ↳ framesintCounts the cross-origin iframes on the page, whose contents no observation can reach from here.
  ↳ lists[]ObservedListAre the repeated content blocks on the page. Nothing in Nodes describes a review card or a product tile that holds no control, so this is the only thing that says the page has records on it at all.
    ↳ refstringIs the short handle for this list inside one observation.
    ↳ selectorstringNames the item container.
    ↳ countintIs how many members the selector matched.
    ↳ sectionstringNames the region of the page the list sits in, when the observer could tell.
    ↳ fields[]ObservedListFieldAre the candidate columns, each relative to the item container.
      ↳ namestringIs the column name the observer proposed.
      ↳ cssstringIs relative to the item container.
      ↳ attributestringNames the attribute the column reads, when it reads one.
      ↳ samplestringIs what the column read on the first member, so a caller can tell a price from a rating without opening the page.
  ↳ paginationObservedPaginationNames the control that reaches the next batch of items, when the page has one.
    ↳ kindstringIs the shape the page uses to reach its next batch, one of link, numbered, more, or infinite.
    ↳ selectorstringTargets the control that advances the listing.
    ↳ labelstringIs the control's visible text.
    ↳ urlstringIs the next page's href when the control is a link.
    ↳ pagesintCounts the numbered page links a pager prints, when it prints any.
textstringThe same snapshot rendered one line per element, ready to drop into a prompt
lists[]ObservedListThe repeated content blocks on the page, each with its item container and candidate columns
  ↳ refstringIs the short handle for this list inside one observation.
  ↳ selectorstringNames the item container.
  ↳ countintIs how many members the selector matched.
  ↳ sectionstringNames the region of the page the list sits in, when the observer could tell.
  ↳ fields[]ObservedListFieldAre the candidate columns, each relative to the item container.
    ↳ namestringIs the column name the observer proposed.
    ↳ cssstringIs relative to the item container.
    ↳ attributestringNames the attribute the column reads, when it reads one.
    ↳ samplestringIs what the column read on the first member, so a caller can tell a price from a rating without opening the page.
paginationObservedPaginationThe control that reaches the next batch of items, absent when the page has none
  ↳ kindstringIs the shape the page uses to reach its next batch, one of link, numbered, more, or infinite.
  ↳ selectorstringTargets the control that advances the listing.
  ↳ labelstringIs the control's visible text.
  ↳ urlstringIs the next page's href when the control is a link.
  ↳ pagesintCounts the numbered page links a pager prints, when it prints any.
has_nextboolWhether the page reported a way on to the next batch, which is what a collecting loop branches on
urlstringWhere the page was when it was observed
wallboolSays the page is a sign-in wall standing between the browser and what was asked for, which is a stable answer rather than a page still arriving. Nothing on such a page is a count of anything
wall_reasonstringNames the signal that decided Wall, empty where there is none
match_urlstringThe substring a later turn finds this tab by, which is the host and path the observation was asked for rather than the one the page landed on. A listing's second page rarely shares its path with its third

Example

name: Read what the page is currently showing
actions:
  - name: page
    component: machine:extension:observe
    vars:
      url: https://example.com/login
      scope: "#login-form"
      max_nodes: 120

outputs:
  elements: "{{ page.text }}"