From 7a7d2fd72406bc41dde4caad4e28a2894e6babeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Soutad=C3=A9?= Date: Sat, 8 Jul 2017 08:42:34 +0200 Subject: [PATCH] Try to raise onChange event and "enter" key before submit form --- chrome_addon/lib/main.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/chrome_addon/lib/main.js b/chrome_addon/lib/main.js index 77a49a4..8e6363a 100644 --- a/chrome_addon/lib/main.js +++ b/chrome_addon/lib/main.js @@ -242,6 +242,16 @@ async function ask_server(form, field, logins, domain, wdomain, mkey, submit) if (submit) { form.removeEventListener("submit", on_sumbit, true); + // Propagate change + change_cb = field.onchange; + if (change_cb) + change_cb(); + // Try to type "enter" + var evt = new KeyboardEvent("keydown"); + delete evt.which; + evt.which = 13; + field.dispatchEvent(evt); + // Submit form form.submit(); } else