mirror of
https://github.com/bitwarden/browser
synced 2025-12-19 01:33:33 +00:00
Cleanup code
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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'})
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user