Repository navigation
the box says what kind of box has focus on the page in front, so a password is typed only into a password box - #38
Merged
Merged
Conversation
…ssword is typed only into a password box
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.
Why
On 10 Oct 2026 a saved-login fill typed the password into Facebook's email box, in plain sight, and pressed Log in. The fill clicks where the AI said each field is, and that click landed on the wrong box. The server had no way to know which box had focus.
What
docker/active-tab/focus.jsis a new content script on every page, top frame only. It tells the extension what kind of box has focus:password,text(email, tel, search, url, number, textarea or contenteditable),other, ornone. It sends only that word, never the box's contents or anything else of the page. It reports on focusin, focusout and input, so a "show password" toggle is seen.background.jskeeps each tab's last focus kind and sends it with the page in front. A new page counts as unknown until it reports.box-hostactive_tabrecordsfocus(only those four words; anything else is dropped) andseq, which counts the browser's reports.GET /v1/chrome/active-tabnow answers{url, atMs, focus, seq}. A reader that clicked a field waits forseqto move before it trustsfocus.content_scripts(<all_urls>,document_idle). Permissions are unchanged:tabsandnativeMessaging.Tests
each_report_says_what_kind_of_box_has_focus. Reports come through numbered, and a word outside the four is dropped.cargo test --workspace --no-fail-fast: everything passes exceptjail::tests::absolute_inside_ok, which fails only on macOS (the/var→/private/vartemp-folder symlink) and is unchanged since well before this PR. Clippy-D warningsand fmt are clean.node --checkpasses on both scripts, and the manifest parses.Live check (image built from this branch,
grok-box:local47946f03)A throwaway container served a test login page: an email box with autofocus, then a password box. I drove it with the box's own
/v1/cua/keyand readGET /v1/chrome/active-tab:"focus":"text","seq":5"focus":"password","seq":7"focus":"none","seq":8"focus":"password","seq":9The server half is hexuria/opengrok-server (gol/fill-right-box). It reads
focusandseqand refuses to type a password anywhere but a password box.