diff --git a/apps/browser-extension/src/utils/formDetector/FieldPatterns.ts b/apps/browser-extension/src/utils/formDetector/FieldPatterns.ts index 1a9340b9b..52f570df5 100644 --- a/apps/browser-extension/src/utils/formDetector/FieldPatterns.ts +++ b/apps/browser-extension/src/utils/formDetector/FieldPatterns.ts @@ -46,9 +46,9 @@ export const EnglishFieldPatterns: FieldPatterns = { password: ['password', 'pwd', 'pass'], birthdate: ['birthdate', 'birth-date', 'dob', 'date-of-birth'], gender: ['gender', 'sex'], - birthDateDay: ['birth-day', 'birthday', 'day', 'birthdate_d'], - birthDateMonth: ['birth-month', 'birthmonth', 'month', 'birthdate_m'], - birthDateYear: ['birth-year', 'birthyear', 'year', 'birthdate_y'] + birthDateDay: ['-day', 'birthdate_d', 'birthdayday', '_day', 'day'], + birthDateMonth: ['-month', 'birthdate_m', 'birthdaymonth', '_month', 'month'], + birthDateYear: ['-year', 'birthdate_y', 'birthdayyear', '_year', 'year'] }; /** diff --git a/apps/browser-extension/src/utils/formDetector/__tests__/FormDetector.en.test.ts b/apps/browser-extension/src/utils/formDetector/__tests__/FormDetector.en.test.ts index 3121ccc76..80603f5ff 100644 --- a/apps/browser-extension/src/utils/formDetector/__tests__/FormDetector.en.test.ts +++ b/apps/browser-extension/src/utils/formDetector/__tests__/FormDetector.en.test.ts @@ -84,4 +84,12 @@ describe('FormDetector English tests', () => { testField(FormField.Email, 'account_name_text_field', htmlFile); }); + describe('English registration form 8 detection (Roblox-style birthdate)', () => { + const htmlFile = 'en-registration-form8.html'; + + testField(FormField.BirthMonth, 'MonthDropdown', htmlFile); + testField(FormField.BirthDay, 'DayDropdown', htmlFile); + testField(FormField.BirthYear, 'YearDropdown', htmlFile); + }); + }); diff --git a/apps/browser-extension/src/utils/formDetector/__tests__/test-forms/en-registration-form8.html b/apps/browser-extension/src/utils/formDetector/__tests__/test-forms/en-registration-form8.html new file mode 100644 index 000000000..de90efdce --- /dev/null +++ b/apps/browser-extension/src/utils/formDetector/__tests__/test-forms/en-registration-form8.html @@ -0,0 +1,163 @@ +