Fix Auto-Submit for eBay

This commit is contained in:
varjolintu 2021-01-09 11:55:33 +02:00
parent 880bad5469
commit 9059a78e2f
2 changed files with 8 additions and 0 deletions

View file

@ -41,6 +41,7 @@ const PREDEFINED_SITELIST = [
];
const kpxcSites = {};
kpxcSites.ebayUrl = 'https://www.ebay.';
kpxcSites.googlePasswordFormUrl = 'https://accounts.google.com/signin/v2/challenge/password';
kpxcSites.googleUrl = 'https://accounts.google.com';
kpxcSites.savedForm = undefined;

View file

@ -171,6 +171,13 @@ kpxcForm.getFormSubmitButton = function(form) {
const buttons = findDiv.getElementsByTagName('button');
kpxcSites.savedForm = form;
return buttons.length > 0 ? buttons[0] : undefined;
} else if (form.action.startsWith(kpxcSites.ebayUrl)) {
// For eBay we must return the first button.
for (const i of form.elements) {
if (i.type === 'button') {
return i;
}
}
}
if (action.includes(document.location.origin + document.location.pathname)) {