1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-20 11:25:37 +01:00

hasOwnProperty continue

This commit is contained in:
Kyle Spearrin 2017-11-11 08:10:47 -05:00
parent 79c2fdac48
commit c6274dd1dc

View File

@ -407,7 +407,10 @@ export default class AutofillService {
for (const f of pageDetails.fields) {
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://developers.google.com/web/fundamentals/design-and-ux/input/forms/
if (!fillFields.cardholderName && this.isFieldMatch(f[attr],
@ -443,7 +446,6 @@ export default class AutofillService {
}
}
}
}
const card = options.cipher.card;
this.makeScriptAction(fillScript, card, fillFields, filledFields, 'cardholderName');
@ -479,7 +481,10 @@ export default class AutofillService {
for (const f of pageDetails.fields) {
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://developers.google.com/web/fundamentals/design-and-ux/input/forms/
if (!fillFields.name && this.isFieldMatch(f[attr],
@ -539,7 +544,6 @@ export default class AutofillService {
}
}
}
}
const identity = options.cipher.identity;
this.makeScriptAction(fillScript, identity, fillFields, filledFields, 'title');