Skip to content

Commit a739a8a

Browse files
committed
fix(computer-use): never click a secure field into focus
1 parent b96170a commit a739a8a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎apps/desktop/native/computer-use/ComputerUse.swift‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,8 @@ func focusByClicking(_ element: AXUIElement, pid: pid_t, snapshot: Snapshot) asy
600600
// The point must land on the editor or a text control inside it, never a button or row nested in a container.
601601
guard takesText(element), frame.contains(center), let hit = elementAtPoint(center) else { return }
602602
let insideEditor = takesText(hit) ? try ancestorPath(hit, to: element) != nil : false
603-
guard CFEqual(hit, element) || insideEditor else { return }
603+
// Secure inputs stay untargetable, so a password field is never clicked into focus either.
604+
guard CFEqual(hit, element) || insideEditor, (try? requireNonSecure(hit)) != nil else { return }
604605
try await coordinateAction { dispatch in
605606
try checkCancellation()
606607
try postMouse(pid: pid, type: .leftMouseDown, point: center, button: .left, windowID: windowID, window: window, frame: frame, dispatch: dispatch)

0 commit comments

Comments
 (0)