mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 09:13:33 +00:00
[PM-18039] Add initial verison of IpcServices to client (#13373)
* feat: add foreground ipc service * refactor: create abstract ipc service in libs * wip: remove IPC service complexity The code was making some wrong assumptions about how IPC is going to work. I'm removing everything and starting the content-script instead * feat: working message sending from page to background * refactor: move into common * feat: somewhat complete web <-> browser link * wip: ping command from web * fix: import path * fix: wip urls * wip: add console log * feat: successfull message sending (not receiving) * feat: implement IPC using new refactored framework * wip: add some console logs * wip: almost working ping/pong * feat: working ping/pong * chore: clean-up ping/pong and some console logs * chore: remove unused file * fix: override lint rule * chore: remove unused ping message * feat: add tests for message queue * fix: adapt to name changes and modifications to SDK branch * fix: missing import * fix: remove content script from manifest The feature is not ready for prodution code yet. We will add dynamic injection with feature-flag support in a follow-up PR * fix: remove fileless lp * fix: make same changes to manifest v2 * fix: initialization functions Add missing error handling, wait for the SDK to load and properly depend on the log service * feat: use named id field * chore: update sdk version to include IPC changes * fix: remove messages$ buffer * fix: forgot to commit package-lock * feat: add additional destination check * feat: only import type in ipc-message * fix: typing issues * feat: check message origin
This commit is contained in:
@@ -14,6 +14,7 @@ import { ConfigService } from "@bitwarden/common/platform/abstractions/config/co
|
||||
import { I18nService as I18nServiceAbstraction } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
import { SdkLoadService } from "@bitwarden/common/platform/abstractions/sdk/sdk-load.service";
|
||||
import { StateService as StateServiceAbstraction } from "@bitwarden/common/platform/abstractions/state.service";
|
||||
import { IpcService } from "@bitwarden/common/platform/ipc";
|
||||
import { NotificationsService } from "@bitwarden/common/platform/notifications";
|
||||
import { ContainerService } from "@bitwarden/common/platform/services/container.service";
|
||||
import { UserAutoUnlockKeyService } from "@bitwarden/common/platform/services/user-auto-unlock-key.service";
|
||||
@@ -38,6 +39,7 @@ export class InitService {
|
||||
private userAutoUnlockKeyService: UserAutoUnlockKeyService,
|
||||
private accountService: AccountService,
|
||||
private versionService: VersionService,
|
||||
private ipcService: IpcService,
|
||||
private sdkLoadService: SdkLoadService,
|
||||
private configService: ConfigService,
|
||||
private bulkEncryptService: BulkEncryptService,
|
||||
@@ -72,6 +74,7 @@ export class InitService {
|
||||
htmlEl.classList.add("locale_" + this.i18nService.translationLocale);
|
||||
this.themingService.applyThemeChangesTo(this.document);
|
||||
this.versionService.applyVersionToWindow();
|
||||
void this.ipcService.init();
|
||||
|
||||
const containerService = new ContainerService(this.keyService, this.encryptService);
|
||||
containerService.attachToGlobal(this.win);
|
||||
|
||||
Reference in New Issue
Block a user