Skip to content

WebKit: background Command-V, and Safari page fields missing from Accessibility #5

Open

Description

@iamnbutler

Focus, clicking, desktop_type and desktop_insert now work in WebKit composers, including Ace's (#82, #68, #88, and ace2 #120, #131 and #141). Two things are still unknown.

1. Background Command-V into a web app that isn't frontmost. A background desktop_key Command-V into a focused WKWebView composer didn't land. Text has a working route through desktop_insert. An image or file paste into the composer doesn't. Before any patch, answer these with Safari in the background and a textarea focused:

  • Is Edit › Paste AXEnabled, both with and without the host's background key-window preparation?
  • Does an Accessibility press of Edit › Paste paste into the textarea?
  • Must the textarea have AXFocused first?

The answers decide between a menu-press route, a foreground fallback, and a clear refusal.

2. Safari page fields missing from the Accessibility tree. In the Oct 15 study (D6), a local Safari page's <input>, <textarea> and contenteditable weren't in desktop_inspect, so the agent had to click coordinates. Chrome and Electron are handled by #107. For Safari, the cause isn't known: WebKit might load its accessibility lazily, or the 200-element inspect cap might cut the tree short. Reproduce it, then fix it or document the workaround.

Activity

  1. iamnbutler commented on Oct 5, 2026

    @iamnbutler
    Author
  2. iamnbutler commented on Oct 5, 2026

    @iamnbutler
    Author
  3. iamnbutler commented on Oct 5, 2026

    @iamnbutler
    Author
  4. iamnbutler commented on Oct 5, 2026

    @iamnbutler
    Author
  5. iamnbutler commented on Oct 5, 2026

    @iamnbutler
    Author
  6. iamnbutler commented on Oct 6, 2026

    @iamnbutler
    Author
  7. iamnbutler commented on Oct 6, 2026

    @iamnbutler
    Author
  8. iamnbutler commented on Oct 7, 2026

    @iamnbutler
    Author
  9. iamnbutler commented on Oct 13, 2026

    @iamnbutler
    Author
  10. transferred this issue fromgithubnext/aceon Oct 13, 2026
  11. iamnbutler commented on Oct 15, 2026

    @iamnbutler
    Author
  12. iamnbutler commented on Oct 17, 2026

    @iamnbutler
    Author
  13. changed the title [-]Focus and paste into WebKit composers with native desktop tools[/-] [+]WebKit: background Command-V, and Safari page fields missing from Accessibility[/+] on Oct 17, 2026
  14. iamnbutler commented on Nov 3, 2026

    @iamnbutler
    ContributorAuthor

    Answers from a WKWebView fixture (native2/fixture/webfix.swift, in #240), driven in the background through Desktop Tools 0.19.0 plus the #240 changes. The fixture is a regular app that isn't frontmost, with a standard Edit menu, and the page logs every focus, paste and input event.

    Is Edit › Paste AXEnabled?

    • Before any preparation: no. desktop_menu refuses it as disabled.
    • After the window is made key without activating the app (SkyLight activation record and a title-bar click): yes, but only while a page field is focused. With no field focused it stays disabled even in the key window.

    Does an Accessibility press of Edit › Paste paste? Yes, once it's enabled. The page logged paste notes types=["text/plain"] text="MENU-PASTE".

    Must the textarea be AXFocused? Yes, in practice. The paste goes to the page's focused field, and with none focused the menu item is disabled.

    Why page fields were missing from Accessibility: WebKit builds a WKWebView's tree only when an assistive client first asks. The first read finds only an AXGroup where the page is, and the AXWebArea appears under it milliseconds later; it isn't the element cap. #240 makes desktop_inspect re-read, for up to 2 s, until the web area appears, so the first inspect lists the fields.

    Why background Command-V didn't reach the page:

    Still open:

    • Safari itself wasn't tested; I wasn't to touch the user's Safari windows. Safari page fields not appearing may have the same lazy-tree cause, but that's unconfirmed.
    • desktop_insert route: "paste" into a web <input> is still refused before sending, because the field's text can't be read back to confirm the paste. Typing remains the route there.
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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions