console.error(error.stack || error);
},
+ connect() {
+ internals.port = chrome.runtime.connect({ name: "content" });
+ internals.port.onMessage.addListener(internals.onMessage);
+ },
+
async joinAudioCall({ currentUrl, tada }) {
try {
const mediaStream = await startMedia();
shouldCreateOffer,
mediaStream,
onOffer: (data) => socket.emit("relayOffer", data),
- socket
+ socket,
});
playTada();
});
},
};
-internals.port = chrome.runtime.connect({ name: "content" });
-internals.port.onMessage.addListener(internals.onMessage);
+internals.connect();
+chrome.runtime.onConnect.addListener(() => {
+ internals.connect();
+});
console.debug("Content Script Loaded");