mirror of
https://github.com/bitwarden/browser.git
synced 2024-09-18 02:41:15 +02:00
not like password if contains "captcha"
This commit is contained in:
parent
eb0bc6a01c
commit
c99403255d
@ -875,12 +875,34 @@ export default class AutofillService implements AutofillServiceInterface {
|
|||||||
const arr: AutofillField[] = [];
|
const arr: AutofillField[] = [];
|
||||||
pageDetails.fields.forEach((f) => {
|
pageDetails.fields.forEach((f) => {
|
||||||
const isPassword = f.type === 'password';
|
const isPassword = f.type === 'password';
|
||||||
const isLikePassword = () => f.type === 'text' &&
|
const valueIsLikePassword = (value: string) => {
|
||||||
(
|
if (value == null) {
|
||||||
(f.htmlID != null && f.htmlID.toLowerCase().indexOf('password') > 0) ||
|
return false;
|
||||||
(f.htmlName != null && f.htmlName.toLowerCase().indexOf('password') > 0) ||
|
}
|
||||||
(f.placeholder != null && f.placeholder.toLowerCase().indexOf('password') > 0)
|
const lowerValue = value.toLowerCase();
|
||||||
);
|
if (lowerValue.indexOf('password') < 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (lowerValue.indexOf('captcha') >= 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
const isLikePassword = () => {
|
||||||
|
if (f.type !== 'text') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (valueIsLikePassword(f.htmlID)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (valueIsLikePassword(f.htmlName)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (valueIsLikePassword(f.placeholder)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
};
|
||||||
if (!f.disabled && (canBeReadOnly || !f.readonly) && (isPassword || isLikePassword())
|
if (!f.disabled && (canBeReadOnly || !f.readonly) && (isPassword || isLikePassword())
|
||||||
&& (canBeHidden || f.viewable)) {
|
&& (canBeHidden || f.viewable)) {
|
||||||
arr.push(f);
|
arr.push(f);
|
||||||
|
Loading…
Reference in New Issue
Block a user