mirror of
https://github.com/bitwarden/clients.git
synced 2026-02-16 05:44:28 +08:00
* Create service factories * Add onInstall hook to service worker * Add factory helper and common options structure * Use factories in main.background * simplify common factory options * Split factory service cache and options. Improve factory method base type handling. * Add dev flag for managed environment.
16 lines
570 B
TypeScript
16 lines
570 B
TypeScript
import MainBackground from "./background/main.background";
|
|
import { onCommandListener } from "./listeners/onCommandListener";
|
|
import { onInstallListener } from "./listeners/onInstallListener";
|
|
|
|
const manifest = chrome.runtime.getManifest();
|
|
|
|
if (manifest.manifest_version === 3) {
|
|
chrome.commands.onCommand.addListener(onCommandListener);
|
|
chrome.runtime.onInstalled.addListener(onInstallListener);
|
|
} else {
|
|
const bitwardenMain = ((window as any).bitwardenMain = new MainBackground());
|
|
bitwardenMain.bootstrap().then(() => {
|
|
// Finished bootstrapping
|
|
});
|
|
}
|