mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 16:53:34 +00:00
Wire up desktop -> browser communication. Add initial biometry support for browser integration
This commit is contained in:
@@ -15,6 +15,8 @@ class Proxy {
|
||||
run() {
|
||||
this.ipc.connect();
|
||||
this.nativeMessage.listen();
|
||||
|
||||
this.ipc.onMessage = this.nativeMessage.send;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ ipc.config.logger = console.warn; // Stdout is used for native messaging
|
||||
|
||||
export default class IPC {
|
||||
private connected = false;
|
||||
public onMessage: (message: object) => void
|
||||
|
||||
connect() {
|
||||
ipc.connectTo('bitwarden', () => {
|
||||
@@ -24,8 +25,8 @@ export default class IPC {
|
||||
console.error('disconnected from world');
|
||||
});
|
||||
|
||||
ipc.of.bitwarden.on('message', (data: any) => {
|
||||
console.error('got a message from world : ', data);
|
||||
ipc.of.bitwarden.on('message', (message: any) => {
|
||||
this.onMessage(message);
|
||||
});
|
||||
|
||||
/*
|
||||
|
||||
@@ -61,7 +61,6 @@ export default class NativeMessage {
|
||||
flushChunksQueue();
|
||||
|
||||
const json = JSON.parse(contentWithoutSize);
|
||||
console.error(json);
|
||||
|
||||
// Forward to desktop application
|
||||
this.ipc.send(json);
|
||||
|
||||
Reference in New Issue
Block a user