mirror of
https://github.com/bitwarden/browser
synced 2025-12-13 23:03:32 +00:00
option to only fill visible fields (for autofill on page load)
This commit is contained in:
@@ -158,6 +158,7 @@ export default class AutofillService implements AutofillServiceInterface {
|
|||||||
|
|
||||||
const fillScript = this.generateFillScript(pd.details, {
|
const fillScript = this.generateFillScript(pd.details, {
|
||||||
skipUsernameOnlyFill: options.skipUsernameOnlyFill || false,
|
skipUsernameOnlyFill: options.skipUsernameOnlyFill || false,
|
||||||
|
onlyVisibleFields: options.onlyVisibleFields || false,
|
||||||
cipher: options.cipher,
|
cipher: options.cipher,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -217,6 +218,7 @@ export default class AutofillService implements AutofillServiceInterface {
|
|||||||
skipTotp: !fromCommand,
|
skipTotp: !fromCommand,
|
||||||
skipLastUsed: true,
|
skipLastUsed: true,
|
||||||
skipUsernameOnlyFill: !fromCommand,
|
skipUsernameOnlyFill: !fromCommand,
|
||||||
|
onlyVisibleFields: !fromCommand,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -306,7 +308,7 @@ export default class AutofillService implements AutofillServiceInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let passwordFields = this.loadPasswordFields(pageDetails, false);
|
let passwordFields = this.loadPasswordFields(pageDetails, false);
|
||||||
if (!passwordFields.length) {
|
if (!passwordFields.length && !options.onlyVisibleFields) {
|
||||||
// not able to find any viewable password fields. maybe there are some "hidden" ones?
|
// not able to find any viewable password fields. maybe there are some "hidden" ones?
|
||||||
passwordFields = this.loadPasswordFields(pageDetails, true);
|
passwordFields = this.loadPasswordFields(pageDetails, true);
|
||||||
}
|
}
|
||||||
@@ -330,7 +332,7 @@ export default class AutofillService implements AutofillServiceInterface {
|
|||||||
if (login.username) {
|
if (login.username) {
|
||||||
username = this.findUsernameField(pageDetails, pf, false, false);
|
username = this.findUsernameField(pageDetails, pf, false, false);
|
||||||
|
|
||||||
if (!username) {
|
if (!username && !options.onlyVisibleFields) {
|
||||||
// not able to find any viewable username fields. maybe there are some "hidden" ones?
|
// not able to find any viewable username fields. maybe there are some "hidden" ones?
|
||||||
username = this.findUsernameField(pageDetails, pf, true, false);
|
username = this.findUsernameField(pageDetails, pf, true, false);
|
||||||
}
|
}
|
||||||
@@ -352,7 +354,7 @@ export default class AutofillService implements AutofillServiceInterface {
|
|||||||
if (login.username && pf.elementNumber > 0) {
|
if (login.username && pf.elementNumber > 0) {
|
||||||
username = this.findUsernameField(pageDetails, pf, false, true);
|
username = this.findUsernameField(pageDetails, pf, false, true);
|
||||||
|
|
||||||
if (!username) {
|
if (!username && !options.onlyVisibleFields) {
|
||||||
// not able to find any viewable username fields. maybe there are some "hidden" ones?
|
// not able to find any viewable username fields. maybe there are some "hidden" ones?
|
||||||
username = this.findUsernameField(pageDetails, pf, true, true);
|
username = this.findUsernameField(pageDetails, pf, true, true);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user