1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-07 04:03:29 +00:00

Added new device type

This commit is contained in:
Todd Martin
2025-06-05 14:05:20 -04:00
parent ba4811125a
commit a1cb6bb639
2 changed files with 8 additions and 0 deletions

View File

@@ -40,6 +40,8 @@ export abstract class BrowserPlatformUtilsService implements PlatformUtilsServic
this.deviceCache = DeviceType.VivaldiExtension;
} else if (BrowserPlatformUtilsService.isChrome(globalContext)) {
this.deviceCache = DeviceType.ChromeExtension;
} else if (BrowserPlatformUtilsService.isDuckDuckGo(globalContext)) {
this.deviceCache = DeviceType.DuckDuckGoExtension;
} else if (BrowserPlatformUtilsService.isSafari(globalContext)) {
this.deviceCache = DeviceType.SafariExtension;
}
@@ -123,6 +125,10 @@ export abstract class BrowserPlatformUtilsService implements PlatformUtilsServic
return this.getDevice() === DeviceType.SafariExtension;
}
private static isDuckDuckGo(globalContext: Window | ServiceWorkerGlobalScope): boolean {
return navigator.userAgent.indexOf(" Ddg/") !== -1;
}
/**
* Safari previous to version 16.1 had a bug which caused artifacts on hover in large extension popups.
* https://bugs.webkit.org/show_bug.cgi?id=218704

View File

@@ -28,6 +28,7 @@ export enum DeviceType {
MacOsCLI = 24,
LinuxCLI = 25,
DuckDuckGoBrowser = 26,
DuckDuckGoExtension = 27,
}
/**
@@ -49,6 +50,7 @@ export const DeviceTypeMetadata: Record<DeviceType, DeviceTypeMetadata> = {
[DeviceType.EdgeExtension]: { category: "extension", platform: "Edge" },
[DeviceType.VivaldiExtension]: { category: "extension", platform: "Vivaldi" },
[DeviceType.SafariExtension]: { category: "extension", platform: "Safari" },
[DeviceType.DuckDuckGoExtension]: { category: "extension", platform: "DuckDuckGo" },
[DeviceType.ChromeBrowser]: { category: "webVault", platform: "Chrome" },
[DeviceType.FirefoxBrowser]: { category: "webVault", platform: "Firefox" },
[DeviceType.OperaBrowser]: { category: "webVault", platform: "Opera" },