Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix: skip password field values in accessibility tree (Windows + Linux)

Louis Beaumont8159641f55a9
diff --git a/crates/screenpipe-a11y/src/tree/linux.rs b/crates/screenpipe-a11y/src/tree/linux.rs
index 9fb52ccc2..b2b7ff7e5 100644
--- a/crates/screenpipe-a11y/src/tree/linux.rs
+++ b/crates/screenpipe-a11y/src/tree/linux.rs
@@ -128,6 +128,7 @@ const STATE_EXPANDED: u32 = 9;
const STATE_FOCUSABLE: u32 = 10;
const STATE_FOCUSED: u32 = 12;
const STATE_SELECTED: u32 = 18;
+const STATE_PASSWORD_TEXT: u32 = 30;
fn has_state(state_set: &[u32], bit: u32) -> bool {
let word = (bit / 32) as usize;
@@ -616,7 +617,12 @@ fn extract_text(
let role_str = role_name(role);
// For editable text (Entry, Text, ComboBox), prefer Text interface content
+ // Never extract the value of password fields
if matches!(role, 79 | 61 | 11) {
+ let state_set = get_accessible_state(conn, aref);
+ if has_state(&state_set, STATE_PASSWORD_TEXT) {
+ return;
+ }
if let Some(text) = get_text_content(conn, aref) {
append_text(&mut state.text_buffer, &text);
let mut node = AccessibilityTreeNode::new(
diff --git a/crates/screenpipe-a11y/src/tree/windows.rs b/crates/screenpipe-a11y/src/tree/windows.rs
index 81198c569..65939b81c 100644
--- a/crates/screenpipe-a11y/src/tree/windows.rs
+++ b/crates/screenpipe-a11y/src/tree/windows.rs
@@ -432,6 +432,10 @@ fn extract_text_from_tree(
// Note: Document is handled separately below — its children are the
// actual web content tree in Electron/browser apps, so we must recurse.
if matches!(ct, "Edit" | "ComboBox") {
+ // Never extract the value of password fields
+ if node.is_password == Some(true) {
+ return;
+ }
if let Some(ref val) = node.value {
if !val.trim().is_empty() {
append_text(buffer, val);