diff --git a/apps/browser/src/platform/services/platform-utils/browser-platform-utils.service.ts b/apps/browser/src/platform/services/platform-utils/browser-platform-utils.service.ts index beac7616d8d..f365419cae6 100644 --- a/apps/browser/src/platform/services/platform-utils/browser-platform-utils.service.ts +++ b/apps/browser/src/platform/services/platform-utils/browser-platform-utils.service.ts @@ -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 diff --git a/libs/common/src/enums/device-type.enum.ts b/libs/common/src/enums/device-type.enum.ts index c462081140e..b571259a3af 100644 --- a/libs/common/src/enums/device-type.enum.ts +++ b/libs/common/src/enums/device-type.enum.ts @@ -28,6 +28,7 @@ export enum DeviceType { MacOsCLI = 24, LinuxCLI = 25, DuckDuckGoBrowser = 26, + DuckDuckGoExtension = 27, } /** @@ -49,6 +50,7 @@ export const DeviceTypeMetadata: Record = { [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" },