From 150699cca80171fb4a5bbe3f345aafe1dfe5734e Mon Sep 17 00:00:00 2001 From: varjolintu Date: Sat, 7 Apr 2018 12:04:01 +0300 Subject: [PATCH] Added save domain only option --- keepassxc-browser/background/page.js | 6 +++++- keepassxc-browser/keepassxc-browser.js | 2 +- keepassxc-browser/options/options.html | 9 +++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/keepassxc-browser/background/page.js b/keepassxc-browser/background/page.js index ab7bd27..2d6a2d1 100755 --- a/keepassxc-browser/background/page.js +++ b/keepassxc-browser/background/page.js @@ -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); }); diff --git a/keepassxc-browser/keepassxc-browser.js b/keepassxc-browser/keepassxc-browser.js index 88c7064..8e19d81 100755 --- a/keepassxc-browser/keepassxc-browser.js +++ b/keepassxc-browser/keepassxc-browser.js @@ -1762,7 +1762,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) { diff --git a/keepassxc-browser/options/options.html b/keepassxc-browser/options/options.html index 55e060f..c7b8d33 100644 --- a/keepassxc-browser/options/options.html +++ b/keepassxc-browser/options/options.html @@ -139,6 +139,15 @@


+

+

+ + When saving new credentials save only the domain instead of full URL. +
+

+

Check for updates of KeePassXC: