Catch broadcast messaging errors.

This commit is contained in:
hackademix 2020-09-04 19:55:21 +02:00
parent 7866f63d8f
commit 658056878c
1 changed files with 5 additions and 1 deletions

View File

@ -246,7 +246,11 @@ var RequestGuard = (() => {
let recipient = {frameId: 0};
for (let tab of await browser.tabs.query({url: ["http://*/*", "https://*/*"]})) {
recipient.tabId = tab.id;
Messages.send("seen", payload, recipient);
try {
Messages.send("seen", payload, recipient);
} catch (e) {
// likely a privileged tab where our content script couldn't run
}
}
}
return;