Skip to content

Commit a274819

Browse files
authored
Merge pull request #2525 from keepassxreboot/fix/credential_banner_improvement
Improve username input detection with Credential Banner
2 parents dccf307 + 064d27b commit a274819

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

keepassxc-browser/content/form.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,11 @@ kpxcForm.onSubmit = async function(e) {
229229
}
230230

231231
const [ usernameField, passwordField, passwordInputs ] = kpxcForm.getCredentialFieldsFromForm(form);
232-
const usernameValue = await kpxcForm.getUsernameValue(usernameField);
232+
233+
// Use the first text field in the form if only username input is missing
234+
const usernameValue = await kpxcForm.getUsernameValue(!usernameField && passwordField
235+
? form?.querySelector('input[type=text]')
236+
: usernameField);
233237
await kpxcForm.activateCredentialBanner(usernameValue, passwordInputs, passwordField);
234238
};
235239

0 commit comments

Comments
 (0)