Skip to content

Chromium AX wake via AXManualAccessibility #19

@Jam-Cai

Description

@Jam-Cai

Chromium-based apps lazy-load accessibility trees; until something triggers population, their text fields appear as empty AX leaves. Setting AXManualAccessibility = true on the AXUIElement wakes the tree.

The naive "set once per app launch" approach isn't enough. Per @m13v's comment below, the real-world implementation also needs:

  1. Per-PID tracking, not per-bundle. The flag gets reset when a renderer process crashes and restarts (frequent in Electron). Track wake state by process ID and re-apply when an unfamiliar PID shows up under the same bundle.
  2. Confirm the wake actually took effect. Setting too early — before the app's window is fully shown — is a silent no-op on Arc and VS Code. Poll for AXChildren to become non-empty before treating the wake as successful.
  3. Reach into the renderer for Electron 28+. The flag on the top-level app element doesn't propagate to webview text fields. Walk down to the renderer AXUIElement and set it there too.

Acceptance

  • Bundle list covers Chrome, Edge, Brave, Arc, and common Electron shells (Slack, VS Code, Discord, Cursor, Linear).
  • Wake state is cached by processIdentifier, not by bundle ID. Re-applied when a new PID appears for a tracked bundle.
  • After setting the flag, poll AXChildren for non-empty with a tunable timeout (~200ms range) before treating the wake as successful. Until then, fall through to the key-event prefix tracker (Key-event prefix tracker as fallback when AX prefix is unavailable #17).
  • For Electron 28+ apps, the renderer AXUIElement is located and the flag set on it too. Defensive renderer-walk on every Chromium-family bundle is acceptable if version detection isn't reliable.
  • No-op for non-Chromium apps.
  • Diagnostics: when wake is attempted but AXChildren stays empty past timeout, log it (debug build only) so we can spot apps where this approach is not working.

Effort: ~half a day of careful AX work plus testing across Chromium variants (originally pitched as smaller before the gotchas above).

Parent: #16

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:focusFocus tracking, AX, caret detectionenhancementNew feature or request

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions