@@ 16,7 16,15 @@ function handleAutofill(msg) {
return;
};
const input = form.querySelector(`input[name="${pair.key}"]`);
+ input.click();
+ input.focus();
input.value = pair.value;
+ input.dispatchEvent(new KeyboardEvent('keydown', {bubbles: true}));
+ input.dispatchEvent(new KeyboardEvent('keypress', {bubbles: true}));
+ input.dispatchEvent(new KeyboardEvent('keyup', {bubbles: true}));
+ input.dispatchEvent(new Event('input', {bubbles: true, cancellable: true}));
+ input.dispatchEvent(new Event('change', {bubbles: true, cancellable: true}));
+ input.blur();
});
}