mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Some fine-tuning
This commit is contained in:
parent
12563189fa
commit
d488496ae1
6 changed files with 23 additions and 11 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@
|
|||
<input type="text" class="form-control form-control-sm" id="add-credentials-username" data-i18n="[placeholder]username" required>
|
||||
</div>
|
||||
<div class="pb-2">
|
||||
<input type="password" class="form-control form-control-sm" id="add-credentials-password"data-i18n="[placeholder]password" required>
|
||||
<input type="password" class="form-control form-control-sm" id="add-credentials-password"data-i18n="[placeholder]password">
|
||||
<div class="form-text help-text" id="add-credentials-password-help-text">
|
||||
<span data-i18n="popupAddCredentialsPasswordText"></span>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -91,13 +91,15 @@ async function addNewCredential() {
|
|||
return [];
|
||||
}
|
||||
|
||||
const password = $('input#add-credentials-password')?.value;
|
||||
browser.tabs.sendMessage(tab?.id, {
|
||||
action: 'add_new_credential', args: {
|
||||
username: $('input#add-credentials-username')?.value,
|
||||
password: $('input#add-credentials-password')?.value,
|
||||
password: password,
|
||||
group: $('input#add-credentials-group')?.value,
|
||||
title: $('input#add-credentials-title')?.value,
|
||||
url: $('input#add-credentials-url')?.value,
|
||||
generatePassword: !password || password?.length === 0
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@
|
|||
<input type="text" class="form-control form-control-sm" id="add-credentials-username" data-i18n="[placeholder]username" required>
|
||||
</div>
|
||||
<div class="pb-2">
|
||||
<input type="password" class="form-control form-control-sm" id="add-credentials-password"data-i18n="[placeholder]password" required>
|
||||
<input type="password" class="form-control form-control-sm" id="add-credentials-password"data-i18n="[placeholder]password">
|
||||
<div class="form-text help-text" id="add-credentials-password-help-text">
|
||||
<span data-i18n="popupAddCredentialsPasswordText"></span>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -366,7 +366,7 @@ Response message data (success, decrypted):
|
|||
```
|
||||
|
||||
### set-login
|
||||
Unencrypted message (downloadFavicon supported in KeePassXC 2.7.0 and later, but not when updating credentials):
|
||||
Unencrypted message:
|
||||
```json
|
||||
{
|
||||
"action": "set-login",
|
||||
|
|
@ -379,7 +379,8 @@ Unencrypted message (downloadFavicon supported in KeePassXC 2.7.0 and later, but
|
|||
"group": "<group name>",
|
||||
"groupUuid": "<group UUID>",
|
||||
"uuid": "<entry UUID>",
|
||||
"downloadFavicon": "true"
|
||||
"downloadFavicon": "true" (KeePassXC 2.7.0 and later, but not when updating credentials)
|
||||
"generatePassword": "true" (KeePassXC 2.7.11 and later)
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue