Closed Bug 1690865 Opened 5 years ago Closed 5 years ago

Look for username and email keywords in input fields when detecting a username field in a form

Categories

(Toolkit :: Password Manager, enhancement, P3)

enhancement

Tracking

()

VERIFIED FIXED
89 Branch
Tracking Status
firefox89 --- verified

People

(Reporter: dimi, Assigned: dimi)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [passwords:heuristics])

Attachments

(3 files)

The heuristic we are using to locate the username works as follow:

  1. Locate the password fields in the form
  2. Searching backward from the first password field, assume the first text field is the username.

So if there is any text field between the real username field and the password field, we can't recognize the right username field. We can add some searching heuristics (like what we did in fathom to detect the new password field) to improve the current heuristic.

Summary: Use fathom to recognize username field → Use Fathom to recognize username field of sign-in/sign-up form
Summary: Use Fathom to recognize username field of sign-in/sign-up form → Use Fathom to recognize username fields of sign-in/sign-up form
Blocks: 1690802
Severity: -- → N/A
Keywords: meta
Priority: -- → P3
Summary: Use Fathom to recognize username fields of sign-in/sign-up form → [meta] Use Fathom to recognize username fields of sign-in/sign-up form
Blocks: 1691017
Blocks: 1692912
Assignee: nobody → dlee
Blocks: 1583576
Status: NEW → ASSIGNED
Keywords: meta
Summary: [meta] Use Fathom to recognize username fields of sign-in/sign-up form → Look for username and email keywords in input fields when detecting a username field in a form

The username searching heuristic locates a username like or an email like field
by:

  1. Checking if the input field's type is 'email'.
  2. Checking if the input field's autocomplete attribute is 'username' or 'email'
  3. Searching 'username' and 'email' keyword in:
    • The input field's "id", "name", "classname", and "placeholder" attributes.
    • The input field's associate label

If any of the above rule matches, we consider the field a username or an
email field depending on the keyword that matches.

When both a username-like and an email-like field are found in a form, select
the username-like field as the final username field. If no field is
found by the above heuristic, assume the first field before the first
password is the username (This is how it works before the patch).

Note. Right now, even with the new heuristic, we still only search fields
preecede the first password field like what we did before. This is because
from the sites I have tested (~250 sites), all the username fields
precede the first password field. If it turns out this is not true for
some sites, we can consider searching all the input fields in the form.

Attachment #9213024 - Attachment description: WIP: Bug 1690865 - P3. Add tests to test isInferredUsername and isInferredEmail → Bug 1690865 - P3. Add tests to test isInferredUsername and isInferredEmail r=sfoster
Attachment #9213024 - Attachment description: Bug 1690865 - P3. Add tests to test isInferredUsername and isInferredEmail r=sfoster → Bug 1690865 - P3. Add tests to test isInferredUsernameField and isInferredEmailField r=sfoster
Pushed by dlee@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6386355a4bd3 P1. Implement a heuristic to locate the username field in a form. r=sfoster,tgiles https://hg.mozilla.org/integration/autoland/rev/92d80c244299 P2. Add testcases for the username searching heuristic r=sfoster,tgiles https://hg.mozilla.org/integration/autoland/rev/71ef95dc36a8 P3. Add tests to test isInferredUsernameField and isInferredEmailField r=sfoster
Flags: qe-verify+

NI? myself to not forget QA verification.

Flags: needinfo?(timea.babos)
No longer blocks: 1691017

Verified-fixed by doing the following check:

Confirmed that the following sites will properly capture the email address and have it displayed in the username field of the Save/Dismiss doorhanger panel (when there are multiple field inputs received, such as name, last name, etc):

  • ebay.com
  • etsy.com
  • lowes.com
  • kijiji.com
  • newegg.com
  • screwfix.com
  • lidl.de
  • hotukdeal.com - with the mention that the username is displayed in the doorhanger (username takes priority over email field for sites where login can be done with both of them)

There were only 2 sites that have issues. due to forms being on separate pages, which will be handled via Bug 348941. (decathlon.fr and manomano.fr)

Status: RESOLVED → VERIFIED
Flags: qe-verify+
Flags: needinfo?(timea.babos)
Blocks: 1645601
Blocks: 1632810
Blocks: 1630614
Blocks: 1616586
No longer blocks: 1616586
No longer blocks: 1632810
Regressions: 1729825
Regressions: 1763220
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: