Repository navigation
Dictation: land the first press in Chromium web fields - #95
Merged
Merged
Conversation
Brave builds a page's accessibility tree only after an application-level request, so the first press after it started or dropped its tree found no field, accepted the page's web area and typed into the body, or tripped a caret guard; the next press worked. Capture now wakes the tree with one app-role read on its first settling read and re-reads for up to 500 ms; web targets must expose settable selected text; and web carets are revalidated by AXSelectedTextMarkerRange, because Gemini's numeric offset flips 10<->38 while the caret never moves. Adds the --verify-focused-text-delivery diagnostic and the opt-in scripts/check_web_text_delivery.sh cold-browser first-press check (~1.5 s). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On gemini.google.com in Brave, the first pedal press after the browser started (or dropped its accessibility tree) often did nothing; the next press worked. Reproduced in a fresh Brave 1.99.55 (Chromium 157) profile with the editor focused: 3 of 4 first presses failed, each in one of three ways:
AXWebAreaitself accepted as a web target, so keystrokes went toBODYand were dropped while delivery reported success;caretChanged.Change
AccessibilityFocusedTextTargeting.capture()treats no-editable-focus as settling: on the first such read it reads the frontmost app'sAXRole(the request that wakes Chromium's page tree), then re-reads every 10 ms for ≤ 500 ms. Secure fields and selections still fail at once. Capture stays synchronous so queued commands keep their order.AXSelectedText; a bare web area or group is never a target.AXSelectedTextMarkerRange(stable across the offset flips, changes on a real caret move — both measured).--verify-focused-text-delivery PID MARKERdiagnostic and opt-inscripts/check_web_text_delivery.sh: a cold throwaway Chromium instance on a local Gemini-shaped page, first press, ~1.5 s. It focuses a window, so it is not ininstall_app.sh.HC_RUN_WEB_TARGET_INTEGRATIONtest the script supersedes.Evidence
scripts/check.shpasses.Alternatives
AXManualAccessibility/AXEnhancedUserInterfaceRecommendation: app-role wake with a bounded synchronous settle.
Recommendation: compare web carets by text marker, falling back to the offset when no marker is exposed.
Flag: none (pre_launch)
🤖 Generated with Claude Code