mirror of
https://github.com/bitwarden/browser
synced 2025-12-13 14:53:33 +00:00
no analytics if in safari private window
This commit is contained in:
@@ -13,6 +13,7 @@ export default class Analytics {
|
|||||||
private appIdService: AppIdService;
|
private appIdService: AppIdService;
|
||||||
private gaTrackingId: string = null;
|
private gaTrackingId: string = null;
|
||||||
private isFirefox = false;
|
private isFirefox = false;
|
||||||
|
private isSafari = false;
|
||||||
private gaFunc: Function = null;
|
private gaFunc: Function = null;
|
||||||
private win: any;
|
private win: any;
|
||||||
private isBackground: boolean = false;
|
private isBackground: boolean = false;
|
||||||
@@ -35,6 +36,7 @@ export default class Analytics {
|
|||||||
|
|
||||||
this.win = win;
|
this.win = win;
|
||||||
this.isFirefox = this.platformUtilsService.isFirefox();
|
this.isFirefox = this.platformUtilsService.isFirefox();
|
||||||
|
this.isSafari = this.platformUtilsService.isSafari();
|
||||||
this.gaTrackingId = this.platformUtilsService.analyticsId();
|
this.gaTrackingId = this.platformUtilsService.analyticsId();
|
||||||
this.isBackground = (typeof this.win.bitwardenIsBackground !== 'undefined');
|
this.isBackground = (typeof this.win.bitwardenIsBackground !== 'undefined');
|
||||||
}
|
}
|
||||||
@@ -56,6 +58,10 @@ export default class Analytics {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.isSafari && safari.application.activeBrowserWindow.activeTab.private) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const disabled = await this.storageService.get<boolean>('disableGa');
|
const disabled = await this.storageService.get<boolean>('disableGa');
|
||||||
// Default for Firefox is disabled.
|
// Default for Firefox is disabled.
|
||||||
if ((this.isFirefox && disabled == null) || disabled != null && disabled) {
|
if ((this.isFirefox && disabled == null) || disabled != null && disabled) {
|
||||||
|
|||||||
Reference in New Issue
Block a user