mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Improve retry on input field detection with Custom Login Fields (#2875)
This commit is contained in:
parent
bf0969aefe
commit
589b14a7cc
2 changed files with 10 additions and 2 deletions
|
|
@ -646,6 +646,11 @@ kpxcFields.useCustomLoginFields = async function() {
|
|||
kpxcTOTPIcons.newIcon(totp, kpxc.databaseState);
|
||||
}
|
||||
|
||||
// No values found
|
||||
if (!username && !password && !totp && !submitButton && stringFields?.length === 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const combinations = [];
|
||||
combinations.push({
|
||||
username: username,
|
||||
|
|
|
|||
|
|
@ -361,7 +361,7 @@ kpxc.initCredentialFields = async function() {
|
|||
|
||||
// Search all remaining inputs from the page, ignore the previous input fields
|
||||
const pageInputs = await kpxcFields.getAllPageInputs(formInputs);
|
||||
if (formInputs.length === 0 && pageInputs.length === 0 && !kpxcFields.isCustomLoginFieldsUsed()) {
|
||||
if (formInputs.length === 0 && pageInputs.length === 0) {
|
||||
// Run 'redetect_credentials' manually if no fields are found after a page load
|
||||
setTimeout(async function() {
|
||||
if (_called.automaticRedetectCompleted) {
|
||||
|
|
@ -653,7 +653,10 @@ kpxc.retrieveCredentials = async function(force = false) {
|
|||
}
|
||||
|
||||
kpxc.url = document.location.href;
|
||||
kpxc.submitUrl = kpxc.getFormActionUrl(kpxc.combinations[0]);
|
||||
|
||||
// Search for first combination that has username or password input set
|
||||
const firstCombination = kpxc.combinations?.find((combination) => combination?.username || combination?.password);
|
||||
kpxc.submitUrl = kpxc.getFormActionUrl(firstCombination);
|
||||
|
||||
if (kpxc.settings.autoRetrieveCredentials && kpxc.url && kpxc.submitUrl) {
|
||||
await kpxc.retrieveCredentialsCallback(
|
||||
|
|
|
|||
Loading…
Reference in a new issue