Support and prioritize fields with autocomplete attributes (#176)

This commit is contained in:
Maxim Baz
2019-09-27 21:17:22 +02:00
committed by GitHub
parent 3a2af64bc3
commit c5a5da15ea

View File

@@ -6,6 +6,7 @@
}; };
const USERNAME_FIELDS = { const USERNAME_FIELDS = {
selectors: [ selectors: [
"input[autocomplete=username i]",
"input[name*=login i]", "input[name*=login i]",
"input[name*=user i]", "input[name*=user i]",
"input[name*=email i]", "input[name*=email i]",
@@ -22,7 +23,10 @@
types: ["email", "text", "tel"] types: ["email", "text", "tel"]
}; };
const PASSWORD_FIELDS = { const PASSWORD_FIELDS = {
selectors: ["input[type=password i]"] selectors: [
"input[type=password i][autocomplete=current-password i]",
"input[type=password i]"
]
}; };
const INPUT_FIELDS = { const INPUT_FIELDS = {
selectors: PASSWORD_FIELDS.selectors selectors: PASSWORD_FIELDS.selectors