1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-21 02:33:46 +00:00

extract analytics class to jslib

This commit is contained in:
Kyle Spearrin
2018-01-26 10:48:32 -05:00
parent f2f34c8e70
commit caf45ad484
8 changed files with 26 additions and 107 deletions

View File

@@ -18,9 +18,6 @@ require('../../scripts/duo.js');
require('../less/libs.less');
require('../less/popup.less');
import Analytics from '../../scripts/analytics';
new Analytics(window);
import DirectivesModule from './directives/directives.module';
import ComponentsModule from './components/components.module';
import ToolsModule from './tools/tools.module';
@@ -35,6 +32,15 @@ window.BrowserApi = BrowserApi;
import { U2f } from '../../scripts/u2f';
window.U2f = U2f;
import { Analytics } from '../../../node_modules/@bitwarden/jslib/src/misc/analytics';
new Analytics(window, () => BrowserApi.gaFilter(), null, null, null, () => {
const bgPage = BrowserApi.getBackgroundPage();
if (!bgPage || !bgPage.bitwardenMain) {
throw 'Cannot resolve background page main.';
}
return bgPage.bitwardenMain;
});
// Model imports
import { Attachment } from '../../../node_modules/@bitwarden/jslib/src/models/domain/attachment';
import { Card } from '../../../node_modules/@bitwarden/jslib/src/models/domain/card';