mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 15:53:27 +00:00
hasOwnProperty continue
This commit is contained in:
@@ -407,7 +407,10 @@ export default class AutofillService {
|
|||||||
|
|
||||||
for (const f of pageDetails.fields) {
|
for (const f of pageDetails.fields) {
|
||||||
for (const attr of CardAttributes) {
|
for (const attr of CardAttributes) {
|
||||||
if (f.hasOwnProperty(attr) && f[attr]) {
|
if (!f.hasOwnProperty(attr) || !f[attr]) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// ref https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill
|
// ref https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill
|
||||||
// ref https://developers.google.com/web/fundamentals/design-and-ux/input/forms/
|
// ref https://developers.google.com/web/fundamentals/design-and-ux/input/forms/
|
||||||
if (!fillFields.cardholderName && this.isFieldMatch(f[attr],
|
if (!fillFields.cardholderName && this.isFieldMatch(f[attr],
|
||||||
@@ -443,7 +446,6 @@ export default class AutofillService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const card = options.cipher.card;
|
const card = options.cipher.card;
|
||||||
this.makeScriptAction(fillScript, card, fillFields, filledFields, 'cardholderName');
|
this.makeScriptAction(fillScript, card, fillFields, filledFields, 'cardholderName');
|
||||||
@@ -479,7 +481,10 @@ export default class AutofillService {
|
|||||||
|
|
||||||
for (const f of pageDetails.fields) {
|
for (const f of pageDetails.fields) {
|
||||||
for (const attr of IdentityAttributes) {
|
for (const attr of IdentityAttributes) {
|
||||||
if (f.hasOwnProperty(attr) && f[attr]) {
|
if (!f.hasOwnProperty(attr) || !f[attr]) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// ref https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill
|
// ref https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill
|
||||||
// ref https://developers.google.com/web/fundamentals/design-and-ux/input/forms/
|
// ref https://developers.google.com/web/fundamentals/design-and-ux/input/forms/
|
||||||
if (!fillFields.name && this.isFieldMatch(f[attr],
|
if (!fillFields.name && this.isFieldMatch(f[attr],
|
||||||
@@ -539,7 +544,6 @@ export default class AutofillService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const identity = options.cipher.identity;
|
const identity = options.cipher.identity;
|
||||||
this.makeScriptAction(fillScript, identity, fillFields, filledFields, 'title');
|
this.makeScriptAction(fillScript, identity, fillFields, filledFields, 'title');
|
||||||
|
|||||||
Reference in New Issue
Block a user