mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Improve username input detection with Credential Banner
This commit is contained in:
parent
dccf307e0c
commit
064d27bf0a
1 changed files with 5 additions and 1 deletions
|
|
@ -229,7 +229,11 @@ kpxcForm.onSubmit = async function(e) {
|
|||
}
|
||||
|
||||
const [ usernameField, passwordField, passwordInputs ] = kpxcForm.getCredentialFieldsFromForm(form);
|
||||
const usernameValue = await kpxcForm.getUsernameValue(usernameField);
|
||||
|
||||
// Use the first text field in the form if only username input is missing
|
||||
const usernameValue = await kpxcForm.getUsernameValue(!usernameField && passwordField
|
||||
? form?.querySelector('input[type=text]')
|
||||
: usernameField);
|
||||
await kpxcForm.activateCredentialBanner(usernameValue, passwordInputs, passwordField);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue