Merge pull request #1782 from stefansundin/banner-tweak

Try harder to prevent false-positive password change banners
This commit is contained in:
Sami Vänttinen 2023-02-25 11:29:53 +02:00 committed by GitHub
commit 3b582ff261
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -158,6 +158,15 @@ kpxcForm.onSubmit = async function(e) {
} else if (kpxc.credentials.length === 1) {
// Single entry found for the page, use the username of it instead of an empty one
usernameValue = kpxc.credentials[0].login;
} else {
// Multiple entries found for the page, try to find out which one might have been used
const pageUuid = await sendMessage('page_get_login_id');
if (pageUuid) {
const credential = kpxc.credentials.find(c => c.uuid === pageUuid);
if (credential) {
usernameValue = credential.login;
}
}
}
// Check if the form has three password fields -> a possible password change form