diff --git a/apps/browser/src/platform/ipc/ipc-background.service.ts b/apps/browser/src/platform/ipc/ipc-background.service.ts new file mode 100644 index 0000000000..914f9b0e4a --- /dev/null +++ b/apps/browser/src/platform/ipc/ipc-background.service.ts @@ -0,0 +1,3 @@ +import { IpcService } from "@bitwarden/platform"; + +export class IpcForegroundService extends IpcService {} diff --git a/apps/browser/src/platform/ipc/ipc-foreground.service.ts b/apps/browser/src/platform/ipc/ipc-foreground.service.ts deleted file mode 100644 index 35de0d3c2b..0000000000 --- a/apps/browser/src/platform/ipc/ipc-foreground.service.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Observable } from "rxjs"; - -import { IpcLink, IpcMessage, IpcService } from "@bitwarden/platform"; -import { Destination, Manager } from "@bitwarden/sdk-internal"; - -export class IpcForegroundService extends IpcService { - private static LinkToBackground = new IpcLink( - async (data) => { - await chrome.runtime.sendMessage({ payload: data } as IpcMessage); - }, - new Observable((subscriber) => { - const listener = (message: IpcMessage) => { - subscriber.next(message.payload); - }; - chrome.runtime.onMessage.addListener(listener); - - return () => chrome.runtime.onMessage.removeListener(listener); - }), - [Destination.BrowserBackground], - ); - - protected override async registerLinks(manager: Manager): Promise { - await manager.register_link(IpcForegroundService.LinkToBackground); - } -} diff --git a/libs/platform/src/ipc/ipc.service.ts b/libs/platform/src/ipc/ipc.service.ts index 5f07d16c15..7e99e17abf 100644 --- a/libs/platform/src/ipc/ipc.service.ts +++ b/libs/platform/src/ipc/ipc.service.ts @@ -3,9 +3,5 @@ import { Manager } from "@bitwarden/sdk-internal"; export abstract class IpcService { protected manager = new Manager(); - async init() { - await this.registerLinks(this.manager); - } - - protected abstract registerLinks(manager: Manager): Promise; + async init() {} }