Skip to content

Fix /action ref-to-element resolution (refs not injected into DOM) #36

@justrach

Description

@justrach

Problem

/action uses document.querySelector('[data-browdie-ref="e0"]') but browdie never injects data-browdie-ref attributes into the DOM. The @eN refs exist only in the a11y tree response, so all actions fail on real pages.

Fix Options

  1. Inject ref attributes via Runtime.evaluate after each snapshot
  2. Resolve refs via DOM.resolveNode using backend_node_id from the a11y tree, then use CDP DOM.focus / Input.dispatchMouseEvent directly

Option 2 is more robust (no DOM mutation side effects).

Acceptance Criteria

  • /action?tab_id=&action=click&ref=e0 successfully clicks the element
  • Works for click, type, fill, hover, press, select, scroll
  • Verified with live Chrome on example.com

Co-authored-by: blackfloofie 265516171+blackfloofie@users.noreply.github.com

Metadata

Metadata

Assignees

No one assigned

    Labels

    blackfloofieCo-author: 265516171+blackfloofie@users.noreply.github.combugSomething isn't workingpriority:p2Medium prioritystatus:doneWork item is complete

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions