1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

[PM-1345] Bugfix - Items with "Re-prompt Masterpassword" fail silently (#5621)

* upon action outside of the extenstion requiring password reprompt, open new tab with reprompt

* allow popup view component to load with default action and send context menu actions on reprompt ciphers to password reprompt

* open password reprompt in new window instead of new tab

* update test and linting

* Apply suggestions from code review

Co-authored-by: Cesar Gonzalez <cesar.a.gonzalezcs@gmail.com>

* add support for getTab in Manifest V2

* remove unneeded loadAction check

* allow auto-fill button in popout window

* add LoadAction type

* update code to use new BrowserPopoutWindowService

* access queryParams with subscribe

* do not dismiss window if no loadAction was specified

* rehide autofill option for non-single-action popout windows

---------

Co-authored-by: Cesar Gonzalez <cesar.a.gonzalezcs@gmail.com>
This commit is contained in:
Jonathan Prusik
2023-08-15 17:27:59 -04:00
committed by GitHub
parent 41bf1247ef
commit d95f1163bf
11 changed files with 191 additions and 31 deletions

View File

@@ -61,6 +61,8 @@ export default class RuntimeBackground {
}
async processMessage(msg: any, sender: chrome.runtime.MessageSender, sendResponse: any) {
const cipherId = msg.data?.cipherId;
switch (msg.command) {
case "loggedIn":
case "unlocked": {
@@ -68,7 +70,7 @@ export default class RuntimeBackground {
if (this.lockedVaultPendingNotifications?.length > 0) {
item = this.lockedVaultPendingNotifications.pop();
await this.browserPopoutWindowService.closeLoginPrompt();
await this.browserPopoutWindowService.closeUnlockPrompt();
}
await this.main.refreshBadge();
@@ -108,13 +110,22 @@ export default class RuntimeBackground {
break;
case "promptForLogin":
case "bgReopenPromptForLogin":
await this.browserPopoutWindowService.openLoginPrompt(sender.tab?.windowId);
await this.browserPopoutWindowService.openUnlockPrompt(sender.tab?.windowId);
break;
case "passwordReprompt":
if (cipherId) {
await this.browserPopoutWindowService.openPasswordRepromptPrompt(sender.tab?.windowId, {
cipherId: cipherId,
senderTabId: sender.tab.id,
action: msg.data?.action,
});
}
break;
case "openAddEditCipher": {
const addEditCipherUrl =
msg.data?.cipherId == null
cipherId == null
? "popup/index.html#/edit-cipher"
: "popup/index.html#/edit-cipher?cipherId=" + msg.data.cipherId;
: "popup/index.html#/edit-cipher?cipherId=" + cipherId;
BrowserApi.openBitwardenExtensionTab(addEditCipherUrl, true);
break;