Merge pull request #743 from keepassxreboot/fix/save_domain_only

Add Save Domain Only option when saving new credentials
This commit is contained in:
Sami Vänttinen 2020-01-08 08:08:56 +02:00 committed by GitHub
commit 5f1f8d71e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 2 deletions

View file

@ -691,6 +691,10 @@
"message": "When saving new credentials, save only the domain instead of full URL.",
"description": "Save domain only option help text."
},
"optionsSaveDomainOnlyCustomLoginHelpText": {
"message": "When saving new custom login fields, save only the domain instead of full URL.",
"description": "Save domain only option 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 with the first given credentials.",
"description": "Auto-Fill And Send option help text."

View file

@ -13,6 +13,7 @@ const defaultSettings = {
showLoginFormIcon: true,
showOTPIcon: true,
saveDomainOnly: true,
saveDomainOnlyNewCreds: false,
autoReconnect: false,
defaultGroup: '',
defaultGroupAlwaysAsk: false
@ -69,6 +70,9 @@ page.initSettings = async function() {
if (!('saveDomainOnly' in page.settings)) {
page.settings.saveDomainOnly = defaultSettings.saveDomainOnly;
}
if (!('saveDomainOnlyNewCreds' in page.settings)) {
page.settings.saveDomainOnlyNewCreds = defaultSettings.saveDomainOnlyNewCreds;
}
if (!('autoReconnect' in page.settings)) {
page.settings.autoReconnect = defaultSettings.autoReconnect;
}

View file

@ -1654,7 +1654,7 @@ kpxc.rememberCredentials = async function(usernameValue, passwordValue, urlValue
let url = this.action;
if (!url) {
url = kpxc.getDocumentLocation();
url = kpxc.settings.saveDomainOnlyNewCreds ? document.location.origin : document.location.href;
if (url.indexOf('?') > 0) {
url = url.substring(0, url.indexOf('?'));
if (url.length < document.location.origin.length) {

View file

@ -161,6 +161,12 @@
<input type="checkbox" name="showLoginNotifications" value="true" /><span data-i18n="optionsCheckboxShowLoginNotifications"></span>
</label>
</div>
<div class="checkbox">
<label class="checkbox">
<input type="checkbox" name="saveDomainOnlyNewCreds" value="true" /><span data-i18n="optionsSaveDomainOnly"></span>
</label>
<span class="help-block" data-i18n="optionsSaveDomainOnlyHelpText"></span>
</div>
</p>
<hr />
<p>
@ -168,7 +174,7 @@
<label class="checkbox">
<input type="checkbox" name="saveDomainOnly" value="true" /><span data-i18n="optionsSaveDomainOnly"></span>
</label>
<span class="help-block" data-i18n="optionsSaveDomainOnlyHelpText"></span>
<span class="help-block" data-i18n="optionsSaveDomainOnlyCustomLoginHelpText"></span>
</div>
</p>
<hr />