Chromium AX wake via AXManualAccessibility
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:
- 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.
- 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
AXChildrento become non-empty before treating the wake as successful. - 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
AXUIElementand 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
AXChildrenfor non-empty with a tunable timeout (~200ms range) before treating the wake as successful. Until then, fall through to the key-event prefix tracker (#17). - [ ] For Electron 28+ apps, the renderer
AXUIElementis 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
AXChildrenstays 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
the AXManualAccessibility flag gets reset in some cases, notably when the app crashes and restarts a renderer process (happens a lot in Electron). we track it per-PID instead of per-bundle and re-set when we detect the renderer PID changed. also worth noting: setting it too early before the app window is actually shown is a silent no-op on Arc and VS Code, we poll for AXChildren non-empty before considering the wake successful. electron 28+ also needs it set on the renderer AXUIElement, not just the top-level app element, or text fields in webviews stay empty.