Merge pull request #898 from keepassxreboot/fix/identify_more_form_buttons

Try to identify more form buttons
This commit is contained in:
Sami Vänttinen 2020-06-08 16:18:23 +03:00 committed by GitHub
commit cd534e856b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1300,6 +1300,16 @@ kpxc.getFormSubmitButton = function(form) {
return buttons[0];
}
// Try to find similar buttons outside the form which are added via 'form' property
for (const e of form.elements) {
if ((e.nodeName === 'BUTTON' && e.type === 'button')
|| (e.nodeName === 'BUTTON' && e.type === 'submit')
|| (e.nodeName === 'INPUT' && e.type === 'button')
|| (e.nodeName === 'BUTTON' && e.type === '')) {
return e;
}
}
return undefined;
};