Don't check contentTabId/contentFrameId for background shims

This commit is contained in:
hensm
2020-01-23 23:43:23 +00:00
parent 87fdec469d
commit 27174c63ff

View File

@@ -141,11 +141,6 @@ export default new class ShimManager {
}
private async handleContentMessage (shim: Shim, message: Message) {
if (shim.contentTabId === undefined
|| shim.contentFrameId === undefined) {
throw logger.error("Shim associated with content sender missing tab/frame ID");
}
const [ destination ] = message.subject.split(":/");
if (destination === "bridge") {
shim.bridgePort.postMessage(message);
@@ -166,6 +161,11 @@ export default new class ShimManager {
}
case "main:/selectReceiverBegin": {
if (shim.contentTabId === undefined
|| shim.contentFrameId === undefined) {
throw logger.error("Shim associated with content sender missing tab/frame ID");
}
const contentTab = await browser.tabs.get(shim.contentTabId);
try {