mirror of
https://github.com/bitwarden/browser
synced 2025-01-20 00:12:09 +01:00
add browser type support for vivaldi and safari
This commit is contained in:
parent
f728585db3
commit
a2f2e6cfc5
@ -3,4 +3,6 @@ export enum BrowserType {
|
||||
Firefox = 3,
|
||||
Opera = 4,
|
||||
Edge = 5,
|
||||
Vivaldi = 19,
|
||||
Safari = 20
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user