mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Merge pull request #723 from stefansundin/autocomplete
Use the autocomplete attribute as a hint
This commit is contained in:
commit
e1e5da2036
1 changed files with 8 additions and 2 deletions
|
|
@ -301,12 +301,17 @@ kpxcFields.isVisible = function(field) {
|
|||
return true;
|
||||
};
|
||||
|
||||
kpxcFields.isAutocompleteAppropriate = function(field) {
|
||||
const autocomplete = field.getLowerCaseAttribute('autocomplete');
|
||||
return !(autocomplete === 'off' || autocomplete === 'new-password');
|
||||
};
|
||||
|
||||
kpxcFields.getAllFields = function() {
|
||||
const fields = [];
|
||||
const inputs = kpxcObserverHelper.getInputs(document);
|
||||
|
||||
for (const i of inputs) {
|
||||
if (kpxcFields.isVisible(i) && !kpxcFields.isSearchField(i)) {
|
||||
if (kpxcFields.isVisible(i) && !kpxcFields.isSearchField(i) && kpxcFields.isAutocompleteAppropriate(i)) {
|
||||
kpxcFields.setUniqueId(i);
|
||||
fields.push(i);
|
||||
}
|
||||
|
|
@ -1027,8 +1032,9 @@ kpxc.initOTPFields = function(inputs, databaseClosed) {
|
|||
for (const i of inputs) {
|
||||
const id = i.getLowerCaseAttribute('id');
|
||||
const name = i.getLowerCaseAttribute('name');
|
||||
const autocomplete = i.getLowerCaseAttribute('autocomplete');
|
||||
|
||||
if (acceptedOTPFields.some(f => (id && id.includes(f)) || (name && name.includes(f)))) {
|
||||
if (autocomplete === 'one-time-code' || acceptedOTPFields.some(f => (id && id.includes(f)) || (name && name.includes(f)))) {
|
||||
kpxcTOTPIcons.newIcon(i, _databaseClosed);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue