Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.
Update FormDetector exclusion logic (#2270)
Leendert de Borst30e3f371b924
diff --git a/apps/browser-extension/src/utils/formDetector/FormDetector.ts b/apps/browser-extension/src/utils/formDetector/FormDetector.tsindex ac2907138..89ec2b5ca 100644--- a/apps/browser-extension/src/utils/formDetector/FormDetector.ts+++ b/apps/browser-extension/src/utils/formDetector/FormDetector.ts@@ -272,6 +272,18 @@ export class FormDetector {* @returns True if the field matches exclusion patterns and should be excluded from autofill.*/private matchesExclusionPatterns(input: HTMLInputElement): boolean {+ /*+ * Explicit credential signals outrank any exclusion patterns, and should not be excluded from autofill.+ */+ if ((input.type ?? input.getAttribute('type') ?? '').toLowerCase() === 'password') {+ return false;+ }++ const autocomplete = (input.getAttribute('data-av-autocomplete') ?? input.getAttribute('autocomplete'))?.toLowerCase() ?? '';+ if (['username', 'email', 'current-password', 'new-password', 'one-time-code'].includes(autocomplete)) {+ return false;+ }+/** Collect text attributes to check. The `class` attribute is intentionally* excluded: utility-CSS frameworks (Tailwind, DaisyUI, etc.) routinely emit