1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-10 05:13:29 +00:00

[PM-25629] Hide Chromium importer for Brave/Windows only (#16456)

* hide chromium importer for Brave/Windows only

* run cargo fmt

* address items found during review

• revert unnecessary changes to windows.rs
• handle exceptions by disabling chromium importer

* refactor filter logic
This commit is contained in:
John Harrington
2025-09-18 12:26:56 -07:00
committed by GitHub
parent 20c8a1ff25
commit 376d2d8bf7

View File

@@ -10,6 +10,7 @@ import {
CollectionView,
} from "@bitwarden/admin-console/common";
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
import { DeviceType } from "@bitwarden/common/enums";
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
import { EncryptService } from "@bitwarden/common/key-management/crypto/abstractions/encrypt.service";
import { PinServiceAbstraction } from "@bitwarden/common/key-management/pin/pin.service.abstraction";
@@ -144,7 +145,22 @@ export class ImportService implements ImportServiceAbstraction {
const capabilities$ = combineLatest([type$, browserEnabled$]).pipe(
map(([type, enabled]) => {
let loaders = availableLoaders(type, client);
if (!enabled) {
let isUnsupported = false;
if (enabled && type === "bravecsv") {
try {
const device = this.system.environment.getDevice();
const isWindowsDesktop = device === DeviceType.WindowsDesktop;
if (isWindowsDesktop) {
isUnsupported = true;
}
} catch {
isUnsupported = true;
}
}
// If the feature flag is disabled, or if the browser is unsupported, remove the chromium loader
if (!enabled || isUnsupported) {
loaders = loaders?.filter((loader) => loader !== Loader.chromium);
}