This commit is contained in:
tophf 2020-10-15 22:00:16 +03:00
parent 140b6f901b
commit 6196624242

View File

@ -191,8 +191,8 @@ async function openURL({
if (newWindow && browser.windows) { if (newWindow && browser.windows) {
return (await browser.windows.create(Object.assign({url}, newWindow)).tabs)[0]; return (await browser.windows.create(Object.assign({url}, newWindow)).tabs)[0];
} }
tab = await getActiveTab(); tab = await getActiveTab() || {url: ''};
if (await isTabReplaceable(tab, url)) { if (isTabReplaceable(tab, url)) {
return activateTab(tab, {url, openerTabId}); return activateTab(tab, {url, openerTabId});
} }
const id = openerTabId == null ? tab.id : openerTabId; const id = openerTabId == null ? tab.id : openerTabId;