Skip to content

browser_snapshot drops the entire tree when an ancestor AX node is ignored (returns only RootWebArea) #31

Description

@ebysofyan

Problem

walkAXTree (src/lib/snapshot.ts:35) returns null for nodes where ignored && !name:

if (ignored && !name) return null;

Chromium routinely emits ignored wrapper nodes — on the page below, Accessibility.getFullAXTree returns a root (RootWebArea) whose single child is { role: "none", ignored: true, name: undefined }. The walk returns null for that child, so the root gets no children and browser_snapshot renders only:

[1] RootWebArea "<title>"

browser_click / browser_fill then have no UIDs to work with, making the plugin unusable on affected pages.

Reproduction

Live Next.js application page (Chrome/Brave 153, macOS):

Step Result
Accessibility.getFullAXTree via raw CDP 436 nodes, 1 root, root has 1 child (ignored: true)
browser_snapshot (current main) 1 node ([1] RootWebArea …)
walkAXTree after traversing through ignored nodes 436 nodes reachable, full tree rendered

Note the existing collapse rule at src/lib/snapshot.ts:48 already passes through unnamed generic/none nodes — ignored wrappers just aren't handled the same way.

Suggested fix

Traverse through ignored wrapper nodes instead of dropping the subtree: return the walked children (collapse when there is exactly one, otherwise keep a pass-through node), consistent with the existing generic/none collapse.

Assignment

Fix is ready — please assign this to me (@ebysofyan) and I'll open a PR. Thanks!

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