mirror of
https://github.com/bitwarden/browser.git
synced 2025-02-05 23:41:28 +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,
|
Firefox = 3,
|
||||||
Opera = 4,
|
Opera = 4,
|
||||||
Edge = 5,
|
Edge = 5,
|
||||||
|
Vivaldi = 19,
|
||||||
|
Safari = 20
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,8 @@ const AnalyticsIds = {
|
|||||||
[BrowserType.Firefox]: 'UA-81915606-7',
|
[BrowserType.Firefox]: 'UA-81915606-7',
|
||||||
[BrowserType.Opera]: 'UA-81915606-8',
|
[BrowserType.Opera]: 'UA-81915606-8',
|
||||||
[BrowserType.Edge]: 'UA-81915606-9',
|
[BrowserType.Edge]: 'UA-81915606-9',
|
||||||
|
[BrowserType.Vivaldi]: 'UA-81915606-15',
|
||||||
|
[BrowserType.Safari]: 'UA-81915606-16',
|
||||||
};
|
};
|
||||||
|
|
||||||
export default class UtilsService implements UtilsServiceInterface {
|
export default class UtilsService implements UtilsServiceInterface {
|
||||||
@ -234,6 +236,8 @@ export default class UtilsService implements UtilsServiceInterface {
|
|||||||
this.browserCache = BrowserType.Opera;
|
this.browserCache = BrowserType.Opera;
|
||||||
} else if (navigator.userAgent.indexOf(' Edge/') !== -1) {
|
} else if (navigator.userAgent.indexOf(' Edge/') !== -1) {
|
||||||
this.browserCache = BrowserType.Edge;
|
this.browserCache = BrowserType.Edge;
|
||||||
|
} else if (navigator.userAgent.indexOf(' Vivaldi/') !== -1) {
|
||||||
|
this.browserCache = BrowserType.Vivaldi;
|
||||||
} else if ((window as any).chrome) {
|
} else if ((window as any).chrome) {
|
||||||
this.browserCache = BrowserType.Chrome;
|
this.browserCache = BrowserType.Chrome;
|
||||||
}
|
}
|
||||||
@ -261,6 +265,14 @@ export default class UtilsService implements UtilsServiceInterface {
|
|||||||
return this.getBrowser() === BrowserType.Opera;
|
return this.getBrowser() === BrowserType.Opera;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isVivaldi(): boolean {
|
||||||
|
return this.getBrowser() === BrowserType.Vivaldi;
|
||||||
|
}
|
||||||
|
|
||||||
|
isSafari(): boolean {
|
||||||
|
return this.getBrowser() === BrowserType.Safari;
|
||||||
|
}
|
||||||
|
|
||||||
analyticsId(): string {
|
analyticsId(): string {
|
||||||
if (this.analyticsIdCache) {
|
if (this.analyticsIdCache) {
|
||||||
return this.analyticsIdCache;
|
return this.analyticsIdCache;
|
||||||
|
Loading…
Reference in New Issue
Block a user