Merge pull request #116 from keepassxreboot/save_only_domain

Added save domain only option
This commit is contained in:
Janek Bevendorff 2018-05-08 21:03:17 +02:00 committed by GitHub
commit 63587bc86e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 2 deletions

View file

@ -6,7 +6,8 @@ const defaultSettings = {
autoFillSingleEntry: false,
autoRetrieveCredentials: true,
showNotifications: true,
showLoginNotifications: true
showLoginNotifications: true,
saveDomainOnly: true
};
var page = {};
@ -42,6 +43,9 @@ page.initSettings = function() {
if (!('showLoginNotifications' in page.settings)) {
page.settings.showLoginNotifications = defaultSettings.showLoginNotifications;
}
if (!('saveDomainOnly' in page.settings)) {
page.settings.saveDomainOnly = defaultSettings.saveDomainOnly;
}
browser.storage.local.set({'settings': page.settings});
resolve(page.settings);
});

View file

@ -1766,7 +1766,7 @@ cip.rememberCredentials = function(usernameValue, passwordValue) {
let url = jQuery(this)[0].action;
if (!url) {
url = document.location.href;
url = cip.settings.saveDomainOnly ? 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

@ -139,6 +139,15 @@
</div>
</p>
<hr />
<p>
<div class="checkbox">
<label class="checkbox">
<input type="checkbox" name="saveDomainOnly" value="true" /> Save domain only.
</label>
<span class="help-block">When saving new credentials save only the domain instead of full URL.</span>
</div>
</p>
<hr />
<p>
Check for updates of KeePassXC:
<br />