Skip to content

Commit

Permalink
Merge pull request #144 from switz/master
Browse files Browse the repository at this point in the history
Remove temporary tabs if keepOldTabs is true. Fixes #93
  • Loading branch information
kintesh authored Feb 5, 2021
2 parents 071fb4e + fc005d4 commit 84eab0c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/containers.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@ const createTab = (url, newTabIndex, currentTabId, openerTabId, cookieStoreId) =
}
});
PreferenceStorage.get('keepOldTabs').then(({value}) => {
if (!value) {
// if keepOldTabs is false, remove the 'old' tab
// -or-
// if the current tab is about:blank or about:newtab
// or some custom moz-extension pages
// we should still close the current tab even though
// keepOldTabs is true, because these are just
// interstitial tabs that are no longer used
if (!value || /^(about:)|(moz-extension:)/.test(currentTab.url)) {
Tabs.remove(currentTabId);
}
}).catch(() => {
Expand Down

0 comments on commit 84eab0c

Please sign in to comment.