mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Add support for downloading favicons after saving a credential
This commit is contained in:
parent
aa0887e2a3
commit
0f1d9941c5
6 changed files with 44 additions and 5 deletions
|
|
@ -775,6 +775,14 @@
|
|||
"message": "When saving new custom login fields, save only the domain instead of full URL.",
|
||||
"description": "Save domain only option help text."
|
||||
},
|
||||
"optionsDownloadFaviconAfterSave": {
|
||||
"message": "Download favicon after save",
|
||||
"description": "Download favicon after save checkbox label text."
|
||||
},
|
||||
"optionsDownloadFaviconAfterSaveHelpText": {
|
||||
"message": "Favicon will be automatically downloaded for the new credential.",
|
||||
"description": "Download favicon after save help text."
|
||||
},
|
||||
"optionsAutoFillAndSendHelpText": {
|
||||
"message": "If credentials are found for a page and the login-type is an HTTP Basic Auth request, KeePassXC-Browser tries to login automatically with the first given credentials. When multiple credentials are present, the extension popup can be used to choose the correct one. Even when this feature is enabled, it is still possible to enter HTTP Basic Auth login manually.",
|
||||
"description": "Auto-Fill And Send option help text."
|
||||
|
|
|
|||
|
|
@ -191,6 +191,10 @@ keepass.updateCredentials = async function(tab, args = []) {
|
|||
messageData.uuid = entryId;
|
||||
}
|
||||
|
||||
if (!entryId && page.settings.downloadFaviconAfterSave) {
|
||||
messageData.downloadFavicon = 'true';
|
||||
}
|
||||
|
||||
if (group && groupUuid) {
|
||||
messageData.group = group;
|
||||
messageData.groupUuid = groupUuid;
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ const defaultSettings = {
|
|||
credentialSorting: SORT_BY_GROUP_AND_TITLE,
|
||||
defaultGroup: '',
|
||||
defaultGroupAlwaysAsk: false,
|
||||
downloadFaviconAfterSave: false,
|
||||
redirectAllowance: 1,
|
||||
saveDomainOnly: true,
|
||||
showLoginFormIcon: true,
|
||||
|
|
@ -101,6 +102,10 @@ page.initSettings = async function() {
|
|||
page.settings.defaultGroupAlwaysAsk = defaultSettings.defaultGroupAlwaysAsk;
|
||||
}
|
||||
|
||||
if (!('downloadFaviconAfterSave' in page.settings)) {
|
||||
page.settings.downloadFaviconAfterSave = defaultSettings.downloadFaviconAfterSave;
|
||||
}
|
||||
|
||||
if (!('redirectAllowance' in page.settings)) {
|
||||
page.settings.redirectAllowance = defaultSettings.redirectAllowance;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -253,6 +253,15 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Download favicon to entry after save -->
|
||||
<div class="form-group" id="downloadFaviconAfterSaveFormGroup">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" name="downloadFaviconAfterSave" id="downloadFaviconAfterSave" value="true">
|
||||
<label class="form-check-label" for="downloadFaviconAfterSave" data-i18n="optionsDownloadFaviconAfterSave"></label>
|
||||
<span class="form-text text-muted" data-i18n="optionsDownloadFaviconAfterSaveHelpText"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Number of allowed redirects -->
|
||||
<div class="form-group">
|
||||
<label id="redirectAllowanceLabel" class="font-weight-normal" for="redirectAllowance" data-i18n="optionsRedirectAllowance" i18n-placeholder="1"></label>
|
||||
|
|
|
|||
|
|
@ -280,6 +280,7 @@ options.initGeneralSettings = function() {
|
|||
}
|
||||
};
|
||||
|
||||
// Also hides/disables any options with KeePassXC versions that are too old
|
||||
options.showKeePassXCVersions = async function(response) {
|
||||
if (response.current === '') {
|
||||
response.current = 'unknown';
|
||||
|
|
@ -293,16 +294,27 @@ options.showKeePassXCVersions = async function(response) {
|
|||
$('#tab-about span.kpxcVersion').text(response.current);
|
||||
$('#tab-general-settings button.checkUpdateKeePassXC:first').attr('disabled', false);
|
||||
|
||||
const result = await browser.runtime.sendMessage({
|
||||
// Hide/disable certain options with older KeePassXC versions than 2.6.0
|
||||
const version260Result = await browser.runtime.sendMessage({
|
||||
action: 'compare_version',
|
||||
args: [ '2.6.0', response.current ]
|
||||
});
|
||||
|
||||
if (result) {
|
||||
if (version260Result) {
|
||||
$('#tab-general-settings #versionRequiredAlert').hide();
|
||||
} else {
|
||||
$('#tab-general-settings #showGroupNameInAutocomplete').attr('disabled', true);
|
||||
}
|
||||
|
||||
// Hide certain options with older KeePassXC versions than 2.7.0
|
||||
const version270Result = await browser.runtime.sendMessage({
|
||||
action: 'compare_version',
|
||||
args: [ '2.7.0', response.current ]
|
||||
});
|
||||
|
||||
if (!version270Result) {
|
||||
$('#tab-general-settings #downloadFaviconAfterSaveFormGroup').hide();
|
||||
}
|
||||
};
|
||||
|
||||
options.getPartiallyHiddenKey = function(key) {
|
||||
|
|
@ -611,7 +623,7 @@ options.initTheme = function() {
|
|||
document.body.setAttribute('data-color-theme', options.settings['colorTheme']);
|
||||
}
|
||||
// Sync localStorage setting
|
||||
let localStorageTheme = localStorage.getItem('colorTheme');
|
||||
const localStorageTheme = localStorage.getItem('colorTheme');
|
||||
if (localStorageTheme !== options.settings['colorTheme']) {
|
||||
localStorage.setItem('colorTheme', options.settings['colorTheme']);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ Response message data (success, decrypted):
|
|||
```
|
||||
|
||||
### set-login
|
||||
Unencrypted message:
|
||||
Unencrypted message (downloadFavicon supported in KeePassXC 2.7.0 and later, but not when updating credentials):
|
||||
```json
|
||||
{
|
||||
"action": "set-login",
|
||||
|
|
@ -243,7 +243,8 @@ Unencrypted message:
|
|||
"password": "passwd1",
|
||||
"group": "<group name>",
|
||||
"groupUuid": "<group UUID>",
|
||||
"uuid": "<entry UUID>"
|
||||
"uuid": "<entry UUID>",
|
||||
"downloadFavicon": "true"
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue