diff --git a/src/enums/browserType.enum.ts b/src/enums/browserType.enum.ts index 2ba3058d9f..addd8911b4 100644 --- a/src/enums/browserType.enum.ts +++ b/src/enums/browserType.enum.ts @@ -3,4 +3,6 @@ export enum BrowserType { Firefox = 3, Opera = 4, Edge = 5, + Vivaldi = 19, + Safari = 20 } diff --git a/src/services/utils.service.ts b/src/services/utils.service.ts index a25dbd868d..b2230de2b9 100644 --- a/src/services/utils.service.ts +++ b/src/services/utils.service.ts @@ -7,6 +7,8 @@ const AnalyticsIds = { [BrowserType.Firefox]: 'UA-81915606-7', [BrowserType.Opera]: 'UA-81915606-8', [BrowserType.Edge]: 'UA-81915606-9', + [BrowserType.Vivaldi]: 'UA-81915606-15', + [BrowserType.Safari]: 'UA-81915606-16', }; export default class UtilsService implements UtilsServiceInterface { @@ -234,6 +236,8 @@ export default class UtilsService implements UtilsServiceInterface { this.browserCache = BrowserType.Opera; } else if (navigator.userAgent.indexOf(' Edge/') !== -1) { this.browserCache = BrowserType.Edge; + } else if (navigator.userAgent.indexOf(' Vivaldi/') !== -1) { + this.browserCache = BrowserType.Vivaldi; } else if ((window as any).chrome) { this.browserCache = BrowserType.Chrome; } @@ -261,6 +265,14 @@ export default class UtilsService implements UtilsServiceInterface { return this.getBrowser() === BrowserType.Opera; } + isVivaldi(): boolean { + return this.getBrowser() === BrowserType.Vivaldi; + } + + isSafari(): boolean { + return this.getBrowser() === BrowserType.Safari; + } + analyticsId(): string { if (this.analyticsIdCache) { return this.analyticsIdCache;