1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-01-03 18:28:13 +01:00

listen to messages from BrowserApi

This commit is contained in:
Kyle Spearrin 2018-01-12 15:29:01 -05:00
parent 497984e353
commit 06c8f17d06
2 changed files with 9 additions and 11 deletions

View File

@ -42,15 +42,6 @@ export default class RuntimeBackground {
} }
}, true); }, 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; 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); await this.processMessage(msg, sender, sendResponse);
}); });
} }

View File

@ -167,7 +167,14 @@ class BrowserApi {
callback(msg, sender, response); callback(msg, sender, response);
}); });
} else if (BrowserApi.isSafariApi) { } 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);
} }
} }
} }