mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Merge pull request #164 from keepassxreboot/improve_field_detection
Improve detection of username fields
This commit is contained in:
commit
ff79d5d8b1
1 changed files with 17 additions and 1 deletions
|
|
@ -899,6 +899,14 @@ cipFields.getAllCombinations = function(inputs) {
|
|||
}
|
||||
}
|
||||
|
||||
if (fields.length === 0 && uField) {
|
||||
const combination = {
|
||||
username: uField[0].getAttribute('data-cip-id'),
|
||||
password: null
|
||||
};
|
||||
fields.push(combination);
|
||||
}
|
||||
|
||||
return fields;
|
||||
};
|
||||
|
||||
|
|
@ -1160,7 +1168,13 @@ let observer = new MutationObserver(function(mutations, observer) {
|
|||
if (inputs.length > neededLength && !_observerIds.includes(mut.target.id)) {
|
||||
// Save target element id for preventing multiple calls to initCredentialsFields()
|
||||
_observerIds.push(mut.target.id);
|
||||
cip.initCredentialFields(true);
|
||||
|
||||
// Sometimes the settings haven't been loaded before new input fields are detected
|
||||
if (Object.keys(cip.settings).length === 0) {
|
||||
cip.init();
|
||||
} else {
|
||||
cip.initCredentialFields(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -1273,6 +1287,8 @@ cip.initCredentialFields = function(forceCall) {
|
|||
}).then(cip.retrieveCredentialsCallback).catch((e) => {
|
||||
console.log(e);
|
||||
});
|
||||
} else {
|
||||
cip.preparePageForMultipleCredentials(cip.credentials);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue