|
|
@@ -29,7 +29,13 @@ singlefile.lib.lazy.bg.main = (() => {
|
|
|
|
|
|
browser.runtime.onMessage.addListener((message, sender) => {
|
|
|
if (message.method == "lazyTimeout.setTimeout") {
|
|
|
- const timeoutId = setTimeout(() => browser.tabs.sendMessage(sender.tab.id, { method: "content.onLazyTimeout", id: timeoutId }), message.delay);
|
|
|
+ const timeoutId = setTimeout(async () => {
|
|
|
+ try {
|
|
|
+ await browser.tabs.sendMessage(sender.tab.id, { method: "content.onLazyTimeout", id: timeoutId });
|
|
|
+ } catch (error) {
|
|
|
+ // ignored
|
|
|
+ }
|
|
|
+ }, message.delay);
|
|
|
return Promise.resolve(timeoutId);
|
|
|
}
|
|
|
if (message.method == "lazyTimeout.clearTimeout") {
|