Skip to content

macOS engine: background Firefox reports the previously focused field as focused, so type_text reads back the wrong field #419

Open

Description

@SSFSKIM

Problem

In background Firefox, after the page moves focus from one field to another, macOS accessibility still reports the earlier field as focused. type_text's read-back then snapshots and polls the wrong element.

The text lands correctly in the newly focused field, but the call can never confirm:

Measured in #414's Firefox identity diagnostic (run 44342395472, Firefox 160 on hosted macOS, main 517ab54 and #414's head):

  • The production snapshot's element was the earlier setup field in 12/12 trials: AXTextField, no subrole. It was never the password input or an ancestor or descendant of it.
  • The DOM showed the password exact and the setup field unchanged, 12/12.
  • No password value or mask appeared in any reply.
  • Literal excerpts matched the setup field only.

This is wrong-target, not a leak: the excerpt is of a field the agent could observe anyway. It is never a wrong success either, because the stale field doesn't change, so it never equals the expected value. But it means type_text into a field that was focused from the page never confirms in background Firefox. The #405 qualification also saw Firefox's AX focus on the web area for its focused-selection path. Related: agent-cursor.md already says background Firefox doesn't report its caret moving.

What to find out

  1. Which focus sources update. Which of Firefox's AX focus sources (the application's AXFocusedUIElement, the window's, the web area's, AXFocused on the elements) update for a page-driven focus change in the background, and which stay stale?
  2. Detecting staleness. Can the read-back detect the stale case before input, for example the claimed element reading AXFocused false, or another element reading AXFocused true? Then refuse it (noFocusedElement or fieldChanged) instead of reading another field.
  3. Finding the real field. If a reliable source exists (a walk for AXFocused true, or Gecko's own text-marker or caret attributes), use it, under macOS engine: background Safari on a large page can't find the focused field for type_text's read-back (text-marker route) #395's and macOS engine: observation never reads a secure field's value, length or selection (protection is the AX provider's today) #405's privacy rules.

Check

In background Firefox, after the page moves focus between two fields, type_text's read-back targets the newly focused field. It confirms 20/20 for plain fields, and gives #414's length confirmation for password fields. No reply carries another field's excerpt.

Spawned by #414 (design ruling 1ea561bc:839: every declared limit gets its own ticket).

Activity

  1. added
    bug
    status:ready-for-implementer
    priority:P3
    on Nov 18, 2026
  2. SSFSKIM commented on Nov 18, 2026

    @SSFSKIM
    OwnerAuthor

    Second Firefox shape, from #414's qualification: a page whose only field is the password input, focused by the page before Firefox went to the background (13/13 setup-valid, Firefox 160 hosted, main 517ab54 and #414 cbce12e). Both heads delivered exactly, including non-BMP text, but answered notTextField: Firefox's AX reports the web area, not the input, as focused. So in background Firefox, type_text's read-back never reaches a password field, whether a field was focused before it (stale focus, above) or not (web area focus). Nothing private appeared in any reply.

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

    bugpriority:P3status:ready-for-implementer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions