diff --git a/keepassxc-browser/_locales/en/messages.json b/keepassxc-browser/_locales/en/messages.json index a38d888..9e64a04 100644 --- a/keepassxc-browser/_locales/en/messages.json +++ b/keepassxc-browser/_locales/en/messages.json @@ -951,6 +951,10 @@ "message": "Username-only Detection", "description": "Site preferences list column title." }, + "optionsColumnImprovedInputFieldDetection": { + "message": "Improved Input Field Detection", + "description": "Improved Input Field Detection column text." + }, "optionsColumnDelete": { "message": "Delete", "description": "Site preferences list column title." @@ -1067,6 +1071,10 @@ "message": "Username-only detection allows KeePassXC-Browser to fill in login details on websites with separate pages for username and password.", "description": "Site preferences info text, fourth part." }, + "optionsSitePreferencesImprovedInputFieldDetectionHelpText": { + "message": "Improved Input Field Detection allows more detailed dynamic input field detection. However, it might affect the page performance. Use with caution.", + "description": "Improved Input Field Detection help text." + }, "optionsSitePreferencesManualAddText": { "message": "Add URL manually", "description": "Label for adding site manually on Site preferences tab." diff --git a/keepassxc-browser/content/keepassxc-browser.js b/keepassxc-browser/content/keepassxc-browser.js index f67e471..dd3a76e 100755 --- a/keepassxc-browser/content/keepassxc-browser.js +++ b/keepassxc-browser/content/keepassxc-browser.js @@ -20,6 +20,7 @@ kpxc.combinations = []; kpxc.credentials = []; kpxc.databaseState = DatabaseState.DISCONNECTED; kpxc.detectedFields = 0; +kpxc.improvedFieldDetectionEnabledForPage = false; kpxc.inputs = []; kpxc.settings = {}; kpxc.singleInputEnabledForPage = false; @@ -682,6 +683,7 @@ kpxc.siteIgnored = async function(condition) { } kpxc.singleInputEnabledForPage = site.usernameOnly; + kpxc.improvedFieldDetectionEnabledForPage = site.improvedFieldDetection; } } diff --git a/keepassxc-browser/content/observer-helper.js b/keepassxc-browser/content/observer-helper.js index f34a3fd..11ed070 100644 --- a/keepassxc-browser/content/observer-helper.js +++ b/keepassxc-browser/content/observer-helper.js @@ -150,11 +150,14 @@ kpxcObserverHelper.getInputs = function(target, ignoreVisibility = false) { inputFields.push(target); } - // Traverse children - const traversedChildren = kpxcObserverHelper.findInputsFromChildren(target); - for (const child of traversedChildren) { - if (!inputFields.includes(child)) { - inputFields.push(child); + // Traverse children, only if Improved Field Detection is enabled for the site + if (kpxc.improvedFieldDetectionEnabledForPage) + { + const traversedChildren = kpxcObserverHelper.findInputsFromChildren(target); + for (const child of traversedChildren) { + if (!inputFields.includes(child)) { + inputFields.push(child); + } } } diff --git a/keepassxc-browser/options/options.css b/keepassxc-browser/options/options.css index 6d03a84..fd57b72 100644 --- a/keepassxc-browser/options/options.css +++ b/keepassxc-browser/options/options.css @@ -96,6 +96,12 @@ tbody { color: var(--kpxc-text-color); } +.table-striped > tbody > tr:nth-of-type(odd) input[type="checkbox"] { + background-color: var(--kpxc-card-background-color) !important; + border-color: var(--kpxc-input-main-border-color) !important; + color: var(--kpxc-text-color) !important; +} + .table tbody td { vertical-align: middle; } @@ -106,6 +112,7 @@ tbody { } #tab-site-preferences td:nth-of-type(3), +#tab-site-preferences td:nth-of-type(4), table td:last-of-type { width: 1px; } diff --git a/keepassxc-browser/options/options.html b/keepassxc-browser/options/options.html index 8c6c35f..b6933f4 100644 --- a/keepassxc-browser/options/options.html +++ b/keepassxc-browser/options/options.html @@ -599,12 +599,10 @@
-
-
-
-
-
-
+