diff options
Diffstat (limited to 'src/background/shared/tabs.js')
-rw-r--r-- | src/background/shared/tabs.js | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/background/shared/tabs.js b/src/background/shared/tabs.js index 277afb2..f1dcc73 100644 --- a/src/background/shared/tabs.js +++ b/src/background/shared/tabs.js @@ -1,13 +1,3 @@ -let prevSelTab = 1; -let currSelTab = 1; - -browser.tabs.onActivated.addListener((activeInfo) => { - return browser.tabs.query({ currentWindow: true }).then(() => { - prevSelTab = currSelTab; - currSelTab = activeInfo.tabId; - }); -}); - const closeTab = (id) => { return browser.tabs.get(id).then((tab) => { if (!tab.pinned) { @@ -102,8 +92,8 @@ const selectLastTab = () => { }); }; -const selectPrevSelTab = () => { - return browser.tabs.update(prevSelTab, { active: true }); +const selectTab = (id) => { + return browser.tabs.update(id, { active: true }); }; const reload = (current, cache) => { @@ -131,6 +121,6 @@ const duplicate = (id) => { export { closeTab, closeTabForce, reopenTab, selectAt, selectByKeyword, selectPrevTab, selectNextTab, selectFirstTab, - selectLastTab, selectPrevSelTab, reload, updateTabPinned, + selectLastTab, selectTab, reload, updateTabPinned, toggleTabPinned, duplicate }; |