Skip to content

Commit

Permalink
createTab: support .opener for #198
Browse files Browse the repository at this point in the history
  • Loading branch information
gdh1995 committed Aug 21, 2020
1 parent b2f6f05 commit 5f664e7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions background/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,8 @@
return onRuntimeError();
}
let tab: Tab | null = null;
if (!tabs) { /* empty */ }
else if (tabs.length > 0) { tab = tabs[0]; }
if (!tabs && !cOptions.opener) { /* empty */ }
else if (tabs && tabs.length > 0) { tab = tabs[0]; }
else if (TabRecency_.curTab_ >= 0) {
tabsGet(TabRecency_.curTab_, function (lastTab): void {
standardCreateTab(onlyNormal, lastTab && [lastTab]);
Expand All @@ -549,6 +549,7 @@
}
openMultiTab((tab ? {
active: tab.active, windowId: tab.windowId,
openerTabId: cOptions.opener ? tab.id : void 0,
index: newTabIndex(tab, cOptions.position)
} : {active: true}) as InfoToCreateMultiTab, cRepeat, cOptions.evenIncognito);
return onRuntimeError();
Expand Down

0 comments on commit 5f664e7

Please sign in to comment.