From 5fb26390d8a8c27c5c4fec2e7918d24a936b72fe Mon Sep 17 00:00:00 2001 From: varjolintu Date: Tue, 6 Mar 2018 23:38:39 +0200 Subject: [PATCH] Remove alert and show autocomplete instead --- keepassxc-browser/keepassxc-browser.js | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/keepassxc-browser/keepassxc-browser.js b/keepassxc-browser/keepassxc-browser.js index 88c7064..7a4d06b 100755 --- a/keepassxc-browser/keepassxc-browser.js +++ b/keepassxc-browser/keepassxc-browser.js @@ -1656,12 +1656,10 @@ cip.fillIn = function(combination, onlyPassword, suppressWarnings) { // user has to select correct credentials by himself if (countPasswords > 1) { if (!suppressWarnings) { - const message = 'Error #105\nMore than one login was found in KeePassXC!\n' + - 'Press the KeePassXC-Browser icon for more options.'; - browser.runtime.sendMessage({ - action: 'alert', - args: [message] - }); + const $target = onlyPassword ? pField : uField; + cipAutocomplete.init($target); + $target.focus(); + jQuery($target).autocomplete('search', jQuery($target).val()); } } else if (countPasswords < 1) { @@ -1676,12 +1674,10 @@ cip.fillIn = function(combination, onlyPassword, suppressWarnings) { } else { if (!suppressWarnings) { - const message = 'Error #104\nMore than one login was found in KeePassXC!\n' + - 'Press the KeePassXC-Browser icon for more options.'; - browser.runtime.sendMessage({ - action: 'alert', - args: [message] - }); + const $target = onlyPassword ? pField : uField; + cipAutocomplete.init($target); + $target.focus(); + jQuery($target).autocomplete('search', jQuery($target).val()); } } }