From 22c836b2a851bf5daa84640b8d80bb91e7a3ffbe Mon Sep 17 00:00:00 2001 From: Torbjorn Tyridal Date: Fri, 26 Feb 2016 09:24:31 +0100 Subject: [PATCH] Trigger change event on Jquery sites More sites are apparently implementing this listener approach (Issue #19) --- ext/data/password-fill-cs.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ext/data/password-fill-cs.js b/ext/data/password-fill-cs.js index 06098ae..430aa31 100644 --- a/ext/data/password-fill-cs.js +++ b/ext/data/password-fill-cs.js @@ -8,10 +8,13 @@ self.port.once("the_password", function (d) { document.activeElement.type === "password") { document.activeElement.value = d; + var el; - if ('angular' in unsafeWindow) { - var el = unsafeWindow.angular.element(document.activeElement); + if ('angular' in unsafeWindow) + el = unsafeWindow.angular.element(document.activeElement); + else if ('$' in unsafeWindow) + el = unsafeWindow.$(document.activeElement); + if (el) el.change(); - } } });