diff --git a/apps/browser/src/tools/popup/guards/file-picker-popout.guard.spec.ts b/apps/browser/src/tools/popup/guards/file-picker-popout.guard.spec.ts index 14fa300c3c1..8f5a7178699 100644 --- a/apps/browser/src/tools/popup/guards/file-picker-popout.guard.spec.ts +++ b/apps/browser/src/tools/popup/guards/file-picker-popout.guard.spec.ts @@ -84,40 +84,15 @@ describe("filePickerPopoutGuard", () => { inSidebarSpy.mockReturnValue(false); }); - it("should open popout and block navigation when not in popout", async () => { + it("should allow navigation without popout requirement", async () => { const guard = filePickerPopoutGuard(); const result = await TestBed.runInInjectionContext(() => guard(mockRoute, mockState)); expect(getDeviceSpy).toHaveBeenCalledWith(window); - expect(inPopoutSpy).toHaveBeenCalledWith(window); - expect(openPopoutSpy).toHaveBeenCalledWith("popup/index.html#/add-send?type=1"); - expect(closePopupSpy).toHaveBeenCalledWith(window); - expect(result).toBe(false); - }); - - it("should allow navigation when already in popout", async () => { - inPopoutSpy.mockReturnValue(true); - - const guard = filePickerPopoutGuard(); - const result = await TestBed.runInInjectionContext(() => guard(mockRoute, mockState)); - expect(openPopoutSpy).not.toHaveBeenCalled(); expect(closePopupSpy).not.toHaveBeenCalled(); expect(result).toBe(true); }); - - it("should not allow sidebar bypass (Safari doesn't support sidebar)", async () => { - inSidebarSpy.mockReturnValue(true); - inPopoutSpy.mockReturnValue(false); - - const guard = filePickerPopoutGuard(); - const result = await TestBed.runInInjectionContext(() => guard(mockRoute, mockState)); - - // Safari requires popout, sidebar is not sufficient - expect(openPopoutSpy).toHaveBeenCalledWith("popup/index.html#/add-send?type=1"); - expect(closePopupSpy).toHaveBeenCalledWith(window); - expect(result).toBe(false); - }); }); describe("Chromium browsers on Linux", () => { diff --git a/apps/browser/src/tools/popup/guards/file-picker-popout.guard.ts b/apps/browser/src/tools/popup/guards/file-picker-popout.guard.ts index e321910153c..461901085e5 100644 --- a/apps/browser/src/tools/popup/guards/file-picker-popout.guard.ts +++ b/apps/browser/src/tools/popup/guards/file-picker-popout.guard.ts @@ -11,9 +11,9 @@ import { DeviceType } from "@bitwarden/common/enums"; * * Browser-specific requirements: * - Firefox: Requires sidebar OR popout (crashes with file picker in popup: https://bugzilla.mozilla.org/show_bug.cgi?id=1292701) - * - Safari: Requires popout only * - Chromium on Linux/Mac: Requires sidebar OR popout * - Chromium on Windows: No special requirement + * - Safari: No special requirement * * @returns CanActivateFn that opens popout and blocks navigation when file picker access is needed */ @@ -33,11 +33,6 @@ export function filePickerPopoutGuard(): CanActivateFn { needsPopout = true; } - // Safari: needs popout only (sidebar not available) - if (deviceType === DeviceType.SafariExtension && !inPopout) { - needsPopout = true; - } - // Chromium on Linux: needs sidebar OR popout for file picker access // All Chromium-based browsers (Chrome, Edge, Opera, Vivaldi) on Linux const isChromiumBased = [ diff --git a/apps/browser/src/vault/popup/components/vault-v2/vault-v2.component.spec.ts b/apps/browser/src/vault/popup/components/vault-v2/vault-v2.component.spec.ts index 4b992d9f1ee..569f8c0bbd0 100644 --- a/apps/browser/src/vault/popup/components/vault-v2/vault-v2.component.spec.ts +++ b/apps/browser/src/vault/popup/components/vault-v2/vault-v2.component.spec.ts @@ -30,8 +30,6 @@ import { DialogService } from "@bitwarden/components"; import { StateProvider } from "@bitwarden/state"; import { DecryptionFailureDialogComponent } from "@bitwarden/vault"; -import { BrowserApi } from "../../../../platform/browser/browser-api"; -import BrowserPopupUtils from "../../../../platform/browser/browser-popup-utils"; import { IntroCarouselService } from "../../services/intro-carousel.service"; import { VaultPopupAutofillService } from "../../services/vault-popup-autofill.service"; import { VaultPopupCopyButtonsService } from "../../services/vault-popup-copy-buttons.service"; @@ -141,8 +139,6 @@ jest jest .spyOn(DecryptionFailureDialogComponent, "open") .mockImplementation((_: DialogService, _params: any) => mockDialogRef as any); -jest.spyOn(BrowserApi, "isPopupOpen").mockResolvedValue(false); -jest.spyOn(BrowserPopupUtils, "openCurrentPagePopout").mockResolvedValue(); describe("VaultV2Component", () => { let component: VaultV2Component; @@ -379,29 +375,13 @@ describe("VaultV2Component", () => { expect(PremiumUpgradeDialogComponent.open).toHaveBeenCalledTimes(1); }); - it("navigateToImport navigates and opens popout if popup is open", fakeAsync(async () => { - (BrowserApi.isPopupOpen as jest.Mock).mockResolvedValueOnce(true); - + it("navigateToImport navigates to import route", fakeAsync(async () => { const ngRouter = TestBed.inject(Router); jest.spyOn(ngRouter, "navigate").mockResolvedValue(true as any); await component["navigateToImport"](); expect(ngRouter.navigate).toHaveBeenCalledWith(["/import"]); - - expect(BrowserPopupUtils.openCurrentPagePopout).toHaveBeenCalled(); - })); - - it("navigateToImport does not popout when popup is not open", fakeAsync(async () => { - (BrowserApi.isPopupOpen as jest.Mock).mockResolvedValueOnce(false); - - const ngRouter = TestBed.inject(Router); - jest.spyOn(ngRouter, "navigate").mockResolvedValue(true as any); - - await component["navigateToImport"](); - - expect(ngRouter.navigate).toHaveBeenCalledWith(["/import"]); - expect(BrowserPopupUtils.openCurrentPagePopout).not.toHaveBeenCalled(); })); it("ngOnInit dismisses intro carousel and opens decryption dialog for non-deleted failures", fakeAsync(() => { diff --git a/apps/browser/src/vault/popup/components/vault-v2/vault-v2.component.ts b/apps/browser/src/vault/popup/components/vault-v2/vault-v2.component.ts index 63d971081df..0b2efd0ad52 100644 --- a/apps/browser/src/vault/popup/components/vault-v2/vault-v2.component.ts +++ b/apps/browser/src/vault/popup/components/vault-v2/vault-v2.component.ts @@ -45,8 +45,6 @@ import { import { DecryptionFailureDialogComponent } from "@bitwarden/vault"; import { CurrentAccountComponent } from "../../../../auth/popup/account-switching/current-account.component"; -import { BrowserApi } from "../../../../platform/browser/browser-api"; -import BrowserPopupUtils from "../../../../platform/browser/browser-popup-utils"; import { PopOutComponent } from "../../../../platform/popup/components/pop-out.component"; import { PopupHeaderComponent } from "../../../../platform/popup/layout/popup-header.component"; import { PopupPageComponent } from "../../../../platform/popup/layout/popup-page.component"; @@ -313,9 +311,6 @@ export class VaultV2Component implements OnInit, AfterViewInit, OnDestroy { async navigateToImport() { await this.router.navigate(["/import"]); - if (await BrowserApi.isPopupOpen()) { - await BrowserPopupUtils.openCurrentPagePopout(window); - } } async dismissVaultNudgeSpotlight(type: NudgeType) { diff --git a/apps/browser/src/vault/popup/settings/vault-settings-v2.component.html b/apps/browser/src/vault/popup/settings/vault-settings-v2.component.html index 225640137e8..263870fa67e 100644 --- a/apps/browser/src/vault/popup/settings/vault-settings-v2.component.html +++ b/apps/browser/src/vault/popup/settings/vault-settings-v2.component.html @@ -25,7 +25,7 @@ 1 - + diff --git a/apps/browser/src/vault/popup/settings/vault-settings-v2.component.ts b/apps/browser/src/vault/popup/settings/vault-settings-v2.component.ts index e085cb21c2d..89cf47f5823 100644 --- a/apps/browser/src/vault/popup/settings/vault-settings-v2.component.ts +++ b/apps/browser/src/vault/popup/settings/vault-settings-v2.component.ts @@ -15,8 +15,6 @@ import { PremiumUpgradePromptService } from "@bitwarden/common/vault/abstraction import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction"; import { BadgeComponent, ItemModule, ToastOptions, ToastService } from "@bitwarden/components"; -import { BrowserApi } from "../../../platform/browser/browser-api"; -import BrowserPopupUtils from "../../../platform/browser/browser-popup-utils"; import { PopOutComponent } from "../../../platform/popup/components/pop-out.component"; import { PopupHeaderComponent } from "../../../platform/popup/layout/popup-header.component"; import { PopupPageComponent } from "../../../platform/popup/layout/popup-page.component"; @@ -88,9 +86,6 @@ export class VaultSettingsV2Component implements OnInit, OnDestroy { async import() { await this.router.navigate(["/import"]); - if (await BrowserApi.isPopupOpen()) { - await BrowserPopupUtils.openCurrentPagePopout(window); - } } async sync() {