Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.
Add full name to form detector (#622)
Leendert de Borst451fe98102bb
diff --git a/browser-extensions/chrome/src/contentScript/Form.ts b/browser-extensions/chrome/src/contentScript/Form.tsindex af07fb92d..ada4112ff 100644--- a/browser-extensions/chrome/src/contentScript/Form.ts+++ b/browser-extensions/chrome/src/contentScript/Form.ts@@ -66,6 +66,10 @@ export function fillCredential(credential: Credential, input: HTMLInputElement)form.emailConfirmField.value = credential.Email;triggerInputEvents(form.emailConfirmField);}+ if (form.fullNameField) {+ form.fullNameField.value = `${credential.Alias.FirstName} ${credential.Alias.LastName}`;+ triggerInputEvents(form.fullNameField);+ }if (form.firstNameField) {form.firstNameField.value = credential.Alias.FirstName;triggerInputEvents(form.firstNameField);diff --git a/browser-extensions/chrome/src/shared/formDetector/FieldPatterns.ts b/browser-extensions/chrome/src/shared/formDetector/FieldPatterns.tsindex 9603593c9..31e1fb0ea 100644--- a/browser-extensions/chrome/src/shared/formDetector/FieldPatterns.ts+++ b/browser-extensions/chrome/src/shared/formDetector/FieldPatterns.ts@@ -5,6 +5,7 @@ export type FieldPatterns = {username: string[];firstName: string[];lastName: string[];+ fullName: string[];email: string[];emailConfirm: string[];password: string[];@@ -29,6 +30,7 @@ export type GenderOptionPatterns = {*/export const EnglishFieldPatterns: FieldPatterns = {username: ['username', 'login', 'identifier', 'user'],+ fullName: ['fullname', 'full-name', 'full name'],firstName: ['firstname', 'first-name', 'fname', 'name', 'given-name'],lastName: ['lastname', 'last-name', 'lname', 'surname', 'family-name'],email: ['email', 'mail', 'emailaddress'],@@ -55,6 +57,7 @@ export const EnglishGenderOptionPatterns: GenderOptionPatterns = {*/export const DutchFieldPatterns: FieldPatterns = {username: ['gebruikersnaam', 'gebruiker', 'login', 'identifier'],+ fullName: ['volledige naam'],firstName: ['voornaam', 'naam'],lastName: ['achternaam'],email: ['e-mailadres', 'e-mail'],@@ -81,6 +84,7 @@ export const DutchGenderOptionPatterns: GenderOptionPatterns = {*/export const CombinedFieldPatterns: FieldPatterns = {username: [...new Set([...EnglishFieldPatterns.username, ...DutchFieldPatterns.username])],+ fullName: [...new Set([...EnglishFieldPatterns.fullName, ...DutchFieldPatterns.fullName])],firstName: [...new Set([...EnglishFieldPatterns.firstName, ...DutchFieldPatterns.firstName])],lastName: [...new Set([...EnglishFieldPatterns.lastName, ...DutchFieldPatterns.lastName])],/**diff --git a/browser-extensions/chrome/src/shared/formDetector/FormDetector.ts b/browser-extensions/chrome/src/shared/formDetector/FormDetector.tsindex 946cb12a3..a8884ad32 100644--- a/browser-extensions/chrome/src/shared/formDetector/FormDetector.ts+++ b/browser-extensions/chrome/src/shared/formDetector/FormDetector.ts@@ -428,6 +428,11 @@ export class FormDetector {detectedFields.push(usernameField);}+ const fullNameField = this.findInputField(wrapper as HTMLFormElement | null, CombinedFieldPatterns.fullName, ['text'], detectedFields);+ if (fullNameField) {+ detectedFields.push(fullNameField);+ }+const firstNameField = this.findInputField(wrapper as HTMLFormElement | null, CombinedFieldPatterns.firstName, ['text'], detectedFields);if (firstNameField) {detectedFields.push(firstNameField);@@ -464,6 +469,7 @@ export class FormDetector {usernameField,passwordField: passwordFields.primary,passwordConfirmField: passwordFields.confirm,+ fullNameField,firstNameField,lastNameField,birthdateField,diff --git a/browser-extensions/chrome/src/shared/formDetector/types/FormFields.ts b/browser-extensions/chrome/src/shared/formDetector/types/FormFields.tsindex 0cde32057..bcb170715 100644--- a/browser-extensions/chrome/src/shared/formDetector/types/FormFields.ts+++ b/browser-extensions/chrome/src/shared/formDetector/types/FormFields.ts@@ -7,6 +7,7 @@ export type FormFields = {passwordConfirmField: HTMLInputElement | null;// Identity fields+ fullNameField: HTMLInputElement | null;firstNameField: HTMLInputElement | null;lastNameField: HTMLInputElement | null;