From dc465f78d9913c95fbd879888d83f9f43ffbc46a Mon Sep 17 00:00:00 2001 From: kkapsner Date: Mon, 9 Sep 2024 19:12:35 +0200 Subject: [PATCH] Consider auto submitted entries when storing new passwords For #99 --- main.js | 27 ++++++++++++--------------- releaseNotes.txt | 2 +- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/main.js b/main.js index 7960d0a..0215d12 100644 --- a/main.js +++ b/main.js @@ -302,15 +302,17 @@ async function choiceModal(host, login, entries){ return cached.uuid; } } - const {selectedUuid, doNotAskAgain} = await openModal({ - path: "modal/choice/index.html", - message: { - host, - login, - entries - }, - defaultReturnValue: {selectedUuid: undefined, doNotAskAgain: false} - }); + const {selectedUuid, doNotAskAgain} = (entries.length === 1 && entries[0].autoSubmit)? + {selectedUuid: entries[0].uuid, doNotAskAgain: false}: + await openModal({ + path: "modal/choice/index.html", + message: { + host, + login, + entries + }, + defaultReturnValue: {selectedUuid: undefined, doNotAskAgain: false} + }); if (selectedUuid !== undefined){ selectedEntries.set(cachedId, {uuid: selectedUuid, doNotAskAgain, timestamp: Date.now()}); @@ -372,12 +374,7 @@ browser.credentials.onCredentialRequested.addListener(async function(credentialI if ( credentialInfo.openChoiceDialog && - credentialsForHost.length && - ( - !autoSubmit || - credentialsForHost.length > 1 || - credentialsForHost[0]?.skipAutoSubmit - ) + credentialsForHost.length ){ const selectedUuid = await choiceModal( credentialInfo.host, diff --git a/releaseNotes.txt b/releaseNotes.txt index af490e0..cbac681 100644 --- a/releaseNotes.txt +++ b/releaseNotes.txt @@ -12,7 +12,7 @@ changes: fixes: - - + - auto submitted entries are not considered when storing new passwords Version 1.8