Add typed messaging

This commit is contained in:
hensm
2020-02-18 07:37:20 +00:00
parent 652fd21f77
commit 2eeaff4c15
19 changed files with 431 additions and 227 deletions

View File

@@ -3,6 +3,7 @@
import defaultOptions from "../defaultOptions";
import loadSender from "../lib/loadSender";
import logger from "../lib/logger";
import messaging from "../lib/messaging";
import options from "../lib/options";
import { getChromeUserAgent } from "../lib/userAgents";
@@ -617,9 +618,9 @@ async function init () {
* established, pass it to createShim to handle the setup
* and maintenance.
*/
browser.runtime.onConnect.addListener(async port => {
messaging.onConnect.addListener(async port => {
if (port.name === "shim") {
ShimManager.createShim(port);
ShimManager.createShim(port as any);
}
});
}