1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-10-02 04:48:57 +02:00

rename bg variables

This commit is contained in:
Kyle Spearrin 2017-12-06 20:19:06 -05:00
parent bc132876c9
commit 985c02c5e1
5 changed files with 10 additions and 10 deletions

View File

@ -1,11 +1,9 @@
import MainBackground from './background/main.background';
// tslint:disable-next-line:variable-name
const bg_isBackground = (window as any).bg_isBackground = true;
// tslint:disable-next-line:variable-name
const bg_main = (window as any).bg_main = new MainBackground();
const bitwardenIsBackground = (window as any).bitwardenIsBackground = true;
const bitwardenMain = (window as any).bitwardenMain = new MainBackground();
// tslint:disable-next-line:no-var-requires
require('./scripts/analytics.js');
bg_main.bootstrap();
bitwardenMain.bootstrap();

View File

@ -120,7 +120,8 @@ class Cipher extends Domain {
model.subTitle = model.login.username;
if (model.login.uri) {
if (this.utilsService == null) {
this.utilsService = chrome.extension.getBackgroundPage().bg_main.utilsService as UtilsService;
this.utilsService = chrome.extension.getBackgroundPage()
.bitwardenMain.utilsService as UtilsService;
}
model.login.domain = this.utilsService.getDomain(model.login.uri);

View File

@ -95,7 +95,8 @@ class CipherString {
const self = this;
if (this.cryptoService == null) {
this.cryptoService = chrome.extension.getBackgroundPage().bg_main.cryptoService as CryptoService;
this.cryptoService = chrome.extension.getBackgroundPage()
.bitwardenMain.cryptoService as CryptoService;
}
return this.cryptoService.getOrgKey(orgId).then((orgKey: any) => {

View File

@ -4,7 +4,7 @@ import { UtilsService } from '../../../services/abstractions/utils.service';
function getBackgroundService<T>(service: string) {
return (): T => {
const page = chrome.extension.getBackgroundPage();
return page ? page.bg_main[service] as T : null;
return page ? page.bitwardenMain[service] as T : null;
};
}

View File

@ -4,7 +4,7 @@
return;
}
var bgMain = bgPage.bg_main;
var bgMain = bgPage.bitwardenMain;
if (!bgMain) {
return;
}
@ -79,7 +79,7 @@
request.send(message);
};
if (typeof bg_isBackground !== 'undefined') {
if (typeof bitwardenIsBackground !== 'undefined') {
ga('send', 'pageview', '/background.html');
}
});