1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-10-02 04:48:57 +02:00

tweaked autofill ignore settings for code review

This commit is contained in:
Addison Beck 2020-09-28 12:07:46 -04:00
parent 307f59065b
commit a2a994cb4d

View File

@ -903,18 +903,16 @@ export default class AutofillService implements AutofillServiceInterface {
if (value == null) {
return false;
}
// Removes all whitespace and _ characters
const cleanedValue = value.toLowerCase().trim().replace(/[\s_]/g, '');
// Removes all whitespace, _ and - characters
const cleanedValue = value.toLowerCase().replace(/[\s_-]/g, '');
if (cleanedValue.indexOf('password') < 0) {
return false;
}
const ignoreList = ['onetimepassword', 'captcha', 'findanything']
for (let index = 0; index < ignoreList.length; index++) {
if (cleanedValue.indexOf(ignoreList[index]) > -1) {
return false;
}
const ignoreList = ['onetimepassword', 'captcha', 'findanything'];
if (ignoreList.some((i) => cleanedValue.indexOf(i) > -1)) {
return false;
}
return true;