diff --git a/apps/browser/src/platform/popup/abstractions/browser-popout-window.service.ts b/apps/browser/src/platform/popup/abstractions/browser-popout-window.service.ts index 9d41878c7541..f48649c4f23a 100644 --- a/apps/browser/src/platform/popup/abstractions/browser-popout-window.service.ts +++ b/apps/browser/src/platform/popup/abstractions/browser-popout-window.service.ts @@ -29,7 +29,7 @@ interface BrowserPopoutWindowService { ): Promise; closePasswordRepromptPrompt(): Promise; openFido2Popout( - senderWindowId: number, + senderWindow: chrome.tabs.Tab, promptData: { sessionId: string; senderTabId: number; diff --git a/apps/browser/src/platform/popup/browser-popout-window.service.ts b/apps/browser/src/platform/popup/browser-popout-window.service.ts index 2c40d3da4741..f72f7bfb3e01 100644 --- a/apps/browser/src/platform/popup/browser-popout-window.service.ts +++ b/apps/browser/src/platform/popup/browser-popout-window.service.ts @@ -96,7 +96,7 @@ class BrowserPopoutWindowService implements BrowserPopupWindowServiceInterface { } async openFido2Popout( - senderWindowId: number, + senderWindow: chrome.tabs.Tab, { sessionId, senderTabId, @@ -114,12 +114,18 @@ class BrowserPopoutWindowService implements BrowserPopupWindowServiceInterface { "?uilocation=popout" + `&sessionId=${sessionId}` + `&fallbackSupported=${fallbackSupported}` + - `&senderTabId=${senderTabId}`; - - return await this.openSingleActionPopout(senderWindowId, promptWindowPath, "fido2Popout", { - width: 200, - height: 500, - }); + `&senderTabId=${senderTabId}` + + `&senderUrl=${encodeURIComponent(senderWindow.url)}`; + + return await this.openSingleActionPopout( + senderWindow.windowId, + promptWindowPath, + "fido2Popout", + { + width: 200, + height: 500, + } + ); } async closeFido2Popout(): Promise { diff --git a/apps/browser/src/vault/fido2/browser-fido2-user-interface.service.ts b/apps/browser/src/vault/fido2/browser-fido2-user-interface.service.ts index 06e814262b81..80af1e05136c 100644 --- a/apps/browser/src/vault/fido2/browser-fido2-user-interface.service.ts +++ b/apps/browser/src/vault/fido2/browser-fido2-user-interface.service.ts @@ -343,7 +343,7 @@ export class BrowserFido2UserInterfaceSession implements Fido2UserInterfaceSessi ) ); - const popoutId = await this.browserPopoutWindowService.openFido2Popout(this.tab.windowId, { + const popoutId = await this.browserPopoutWindowService.openFido2Popout(this.tab, { sessionId: this.sessionId, senderTabId: this.tab.id, fallbackSupported: this.fallbackSupported, diff --git a/apps/browser/src/vault/popup/components/fido2/fido2.component.ts b/apps/browser/src/vault/popup/components/fido2/fido2.component.ts index e67204448a9b..b774cdd93e89 100644 --- a/apps/browser/src/vault/popup/components/fido2/fido2.component.ts +++ b/apps/browser/src/vault/popup/components/fido2/fido2.component.ts @@ -89,6 +89,7 @@ export class Fido2Component implements OnInit, OnDestroy { map((queryParamMap) => ({ sessionId: queryParamMap.get("sessionId"), senderTabId: queryParamMap.get("senderTabId"), + senderUrl: queryParamMap.get("senderUrl"), })) ); @@ -97,7 +98,7 @@ export class Fido2Component implements OnInit, OnDestroy { concatMap(async ([queryParams, message]) => { this.sessionId = queryParams.sessionId; this.senderTabId = queryParams.senderTabId; - + this.url = queryParams.senderUrl; // For a 'NewSessionCreatedRequest', abort if it doesn't belong to the current session. if ( message.type === "NewSessionCreatedRequest" && @@ -145,8 +146,6 @@ export class Fido2Component implements OnInit, OnDestroy { concatMap(async (message) => { switch (message.type) { case "ConfirmNewCredentialRequest": { - const activeTabs = await BrowserApi.getActiveTabs(); - this.url = activeTabs[0].url; const equivalentDomains = this.settingsService.getEquivalentDomains(this.url); this.ciphers = (await this.cipherService.getAllDecrypted()).filter(