From 02cd4bd4a423886b38ae40e69801a63f10f2cbc7 Mon Sep 17 00:00:00 2001 From: Guillaume Vincent Date: Mon, 6 Jun 2016 17:15:10 +0200 Subject: [PATCH] dispatch input event to simulate user input --- extension/content.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/extension/content.js b/extension/content.js index bfb46c7..8144bd4 100644 --- a/extension/content.js +++ b/extension/content.js @@ -3,6 +3,11 @@ chrome.runtime.onMessage.addListener(message => { const loginForm = getLoginForm(); loginForm.loginField.value = message.login; loginForm.passwordField.value = message.password; + + var event = new Event('input'); + loginForm.loginField.dispatchEvent(event); + loginForm.passwordField.dispatchEvent(event); + loginForm.form.submit(); });