diff --git a/keepassxc-browser/background/keepass.js b/keepassxc-browser/background/keepass.js index e4bf979..efd69b1 100755 --- a/keepassxc-browser/background/keepass.js +++ b/keepassxc-browser/background/keepass.js @@ -46,13 +46,13 @@ browser.storage.local.get({ 'latestKeePassXC': { 'version': '', 'lastChecked': n //-------------------------------------------------------------------------- keepass.addCredentials = async function(tab, args = []) { - const [ username, password, url, group, groupUuid ] = args; - return keepass.updateCredentials(tab, [ null, username, password, url, group, groupUuid ]); + const [ username, password, url, group, groupUuid, generatePassword ] = args; + return keepass.updateCredentials(tab, [ null, username, password, url, group, groupUuid, generatePassword ]); }; keepass.updateCredentials = async function(tab, args = []) { try { - const [ entryId, username, password, url, group, groupUuid ] = args; + const [ entryId, username, password, url, group, groupUuid, generatePassword ] = args; const taResponse = await keepass.testAssociation(tab); if (!taResponse) { browserAction.showDefault(tab); @@ -69,7 +69,8 @@ keepass.updateCredentials = async function(tab, args = []) { login: username, password: password, url: url, - submitUrl: url + submitUrl: url, + generatePassword: generatePassword }; if (entryId) { diff --git a/keepassxc-browser/background/page.js b/keepassxc-browser/background/page.js index 6229ff9..3c91af2 100755 --- a/keepassxc-browser/background/page.js +++ b/keepassxc-browser/background/page.js @@ -176,8 +176,14 @@ page.addNewCredential = async function(tab, args) { }; const saveToDefaultGroup = async function(creds) { - const args = [ creds.username, creds.password, creds.url, creds.group ]; - const res = await keepass.addCredentials(tab, args); + const res = await keepass.addCredentials(tab, [ + creds.username, + creds.password, + creds.url, + creds.group, + undefined, + creds?.generatePassword + ]); return res; }; @@ -206,6 +212,7 @@ page.addNewCredential = async function(tab, args) { args.url, newGroup.name, newGroup.uuid, + args?.generatePassword ]); return res; } @@ -219,6 +226,7 @@ page.addNewCredential = async function(tab, args) { args.url, groupName, groupUUID, + args?.generatePassword ]); return res; }; diff --git a/keepassxc-browser/popups/popup.html b/keepassxc-browser/popups/popup.html index de48d9b..2f6771c 100644 --- a/keepassxc-browser/popups/popup.html +++ b/keepassxc-browser/popups/popup.html @@ -158,7 +158,7 @@