Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Update Filter.ts (#801)

Leendert de Borst791f8a758b49
diff --git a/browser-extension/src/entrypoints/contentScript/Filter.ts b/browser-extension/src/entrypoints/contentScript/Filter.ts
index 6119560af..c5a876eff 100644
--- a/browser-extension/src/entrypoints/contentScript/Filter.ts
+++ b/browser-extension/src/entrypoints/contentScript/Filter.ts
@@ -1,7 +1,7 @@
import { CombinedStopWords } from "@/utils/formDetector/FieldPatterns";
import { Credential } from "../../utils/types/Credential";
-interface CredentialWithPriority extends Credential {
+type CredentialWithPriority = Credential & {
priority: number;
}
@@ -41,11 +41,11 @@ export function filterCredentials(credentials: Credential[], currentUrl: string,
// Prepare page title words for matching
const titleWords = pageTitle.length > 0
? pageTitle.toLowerCase()
- .split(/\s+/)
- .filter(word =>
- word.length > 3 &&
+ .split(/\s+/)
+ .filter(word =>
+ word.length > 3 &&
!CombinedStopWords.has(word.toLowerCase())
- )
+ )
: [];
// Check for base URL matches and page title matches
@@ -101,7 +101,7 @@ export function filterCredentials(credentials: Credential[], currentUrl: string,
new Map(filtered
.sort((a, b) => a.priority - b.priority)
.map(cred => [cred.Id, cred]))
- .values()
+ .values()
);
// Show max 3 results
return uniqueCredentials.slice(0, 3);