Skip to content

Commit

Permalink
Consider auto submitted entries when storing new passwords
Browse files Browse the repository at this point in the history
For #99
  • Loading branch information
kkapsner committed Sep 9, 2024
1 parent 3fcfbc1 commit dc465f7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
27 changes: 12 additions & 15 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()});
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion releaseNotes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ changes:

fixes:

-
- auto submitted entries are not considered when storing new passwords

Version 1.8

Expand Down

0 comments on commit dc465f7

Please sign in to comment.