mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-29 17:38:04 +01:00
listen to messages from BrowserApi
This commit is contained in:
parent
497984e353
commit
06c8f17d06
@ -42,15 +42,6 @@ export default class RuntimeBackground {
|
||||
}
|
||||
}, true);
|
||||
|
||||
this.runtime.addEventListener('message', async (msgEvent: any) => {
|
||||
await this.processMessage(msgEvent.message, {
|
||||
tab: {
|
||||
id: null, // TODO
|
||||
},
|
||||
frameId: null,
|
||||
}, () => { /* No responses in Safari */ });
|
||||
}, false);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -67,7 +58,7 @@ export default class RuntimeBackground {
|
||||
});
|
||||
}
|
||||
|
||||
this.runtime.onMessage.addListener(async (msg: any, sender: any, sendResponse: any) => {
|
||||
BrowserApi.messageListener(async (msg: any, sender: any, sendResponse: any) => {
|
||||
await this.processMessage(msg, sender, sendResponse);
|
||||
});
|
||||
}
|
||||
|
@ -167,7 +167,14 @@ class BrowserApi {
|
||||
callback(msg, sender, response);
|
||||
});
|
||||
} else if (BrowserApi.isSafariApi) {
|
||||
// TODO
|
||||
safari.application.addEventListener('message', async (msgEvent: any) => {
|
||||
callback(msgEvent.message, {
|
||||
tab: {
|
||||
id: null, // TODO
|
||||
},
|
||||
frameId: null,
|
||||
}, () => { /* No responses in Safari */ });
|
||||
}, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user