From 4a9613f6bb171294a666b5ce7780f5f545609998 Mon Sep 17 00:00:00 2001 From: varjolintu Date: Thu, 15 Aug 2019 12:34:26 +0300 Subject: [PATCH] Add support for skip Auto-Submit property --- keepassxc-browser/content/keepassxc-browser.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/keepassxc-browser/content/keepassxc-browser.js b/keepassxc-browser/content/keepassxc-browser.js index fe60ba0..e668b25 100755 --- a/keepassxc-browser/content/keepassxc-browser.js +++ b/keepassxc-browser/content/keepassxc-browser.js @@ -1230,12 +1230,18 @@ kpxc.fillIn = function(combination, onlyPassword, suppressWarnings) { return; } + let skipAutoSubmit = false; const uField = _f(combination.username); const pField = _f(combination.password); // Exactly one pair of credentials available if (kpxc.credentials.length === 1) { let filledIn = false; + + if (kpxc.credentials[0].skipAutoSubmit !== undefined) { + skipAutoSubmit = kpxc.credentials[0].skipAutoSubmit === 'true'; + } + if (uField && (!onlyPassword || _singleInputEnabledForPage)) { kpxc.setValueWithChange(uField, kpxc.credentials[0].login); browser.runtime.sendMessage({ @@ -1272,6 +1278,11 @@ kpxc.fillIn = function(combination, onlyPassword, suppressWarnings) { } else if (combination.loginId !== undefined && kpxc.credentials[combination.loginId]) { // Specific login ID given let filledIn = false; + + if (kpxc.credentials[0].skipAutoSubmit !== undefined) { + skipAutoSubmit = kpxc.credentials[combination.loginId].skipAutoSubmit === 'true'; + } + if (uField && (!onlyPassword || _singleInputEnabledForPage)) { kpxc.setValueWithChange(uField, kpxc.credentials[combination.loginId].login); browser.runtime.sendMessage({ @@ -1322,6 +1333,10 @@ kpxc.fillIn = function(combination, onlyPassword, suppressWarnings) { valPassword = c.password; valUsername = c.login; valStringFields = c.stringFields; + + if (c.skipAutoSubmit !== undefined) { + skipAutoSubmit = c.skipAutoSubmit === 'true'; + } } } @@ -1384,7 +1399,7 @@ kpxc.fillIn = function(combination, onlyPassword, suppressWarnings) { } // Auto-submit - if (kpxc.settings.autoSubmit) { + if (kpxc.settings.autoSubmit && !skipAutoSubmit) { const form = kpxc.u.form || kpxc.p.form; const submitButton = kpxc.getSubmitButton(form); if (submitButton !== undefined) {