1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-11 14:48:46 +01:00
bitwarden-browser/apps/desktop/src/proxy/native-messaging-proxy.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
616 B
TypeScript
Raw Normal View History

import IPC from "./ipc";
2021-02-03 19:21:22 +01:00
import NativeMessage from "./nativemessage";
2020-10-21 16:48:40 +02:00
// Proxy is a lightweight application which provides bi-directional communication
// between the browser extension and a running desktop application.
//
// Browser extension <-[native messaging]-> proxy <-[ipc]-> desktop
2020-11-23 18:37:04 +01:00
export class NativeMessagingProxy {
2020-10-12 18:03:16 +02:00
private ipc: IPC;
private nativeMessage: NativeMessage;
constructor() {
this.ipc = new IPC();
this.nativeMessage = new NativeMessage(this.ipc);
}
run() {
this.ipc.connect();
this.nativeMessage.listen();
2020-11-30 15:10:57 +01:00
this.ipc.onMessage = this.nativeMessage.send;
}
}