1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 01:33:33 +00:00

Cleanup code

This commit is contained in:
Hinton
2020-10-21 16:48:40 +02:00
parent 9ff0f204d8
commit 77fc0ce55b
4 changed files with 25 additions and 23 deletions

View File

@@ -3,6 +3,10 @@ import IPC from './ipc';
const args = process.argv.slice(2);
// 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
class Proxy {
private ipc: IPC;
private nativeMessage: NativeMessage;

View File

@@ -17,12 +17,16 @@ export default class IPC {
'## connected to bitwarden desktop ##',
ipc.config.delay
);
// Notify browser extension, connection is established to desktop application.
this.onMessage({command: 'connected'})
});
ipc.of.bitwarden.on('disconnect', () => {
this.connected = false;
console.error('disconnected from world');
// Notify browser extension, no connection to desktop application.
this.onMessage({command: 'disconnected'})
});