Try to identify more form buttons

This commit is contained in:
varjolintu 2020-06-04 10:45:52 +03:00
parent 1ef4543f95
commit 39d5e2d5c6

View file

@ -1283,6 +1283,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;
};