From 6bd9491592bf3475f7ccfaa8fcaabae36ad1d507 Mon Sep 17 00:00:00 2001 From: varjolintu Date: Sun, 17 Sep 2023 09:14:53 +0300 Subject: [PATCH] Use the first combination if active element is not found --- keepassxc-browser/content/fill.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keepassxc-browser/content/fill.js b/keepassxc-browser/content/fill.js index cb3f3e6..2bd0ff8 100644 --- a/keepassxc-browser/content/fill.js +++ b/keepassxc-browser/content/fill.js @@ -48,8 +48,8 @@ kpxcFill.fillInFromActiveElement = async function(passOnly = false) { // Fill from combination, if found kpxcFill.fillFromCombination = async function(elem, passOnly) { const combination = passOnly - ? kpxc.combinations.find(c => c.password === elem) - : kpxc.combinations.find(c => c.username === elem); + ? kpxc.combinations.find(c => c.password === elem) ?? kpxc.combinations.find(c => c.password) + : kpxc.combinations.find(c => c.username === elem) ?? kpxc.combinations.find(c => c.username); if (!combination) { logDebug('Error: No username/password field combination found.'); return false;