If the next link can't be opened in the current tab, create a new one for it instead.

This commit is contained in:
Bauke 2020-11-16 22:17:56 +01:00
parent 93a665dc63
commit 13cd59bbe0
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
1 changed files with 6 additions and 1 deletions

View File

@ -36,7 +36,12 @@ browser.browserAction.onClicked.addListener(async () => {
data: nextItem
};
await browser.tabs.sendMessage(tabs[0].id!, message);
try {
await browser.tabs.sendMessage(tabs[0].id!, message);
} catch {
await browser.tabs.create({active: true, url: nextItem.url});
}
await removeQItem(nextItem.id);
}
}, 500);