diff options
Diffstat (limited to 'src/background/tabs.js')
-rw-r--r-- | src/background/tabs.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/background/tabs.js b/src/background/tabs.js index 20ef286..000bd7d 100644 --- a/src/background/tabs.js +++ b/src/background/tabs.js @@ -1,20 +1,20 @@ -const selectPrevTab = (current) => { +const selectPrevTab = (current, count) => { chrome.tabs.query({ currentWindow: true }, (tabs) => { if (tabs.length < 2) { return; } - let select = (current - 1) % tabs.length + let select = (current - count) % tabs.length let id = tabs[select].id; chrome.tabs.update(id, { active: true }) }); }; -const selectNextTab = (current) => { +const selectNextTab = (current, count) => { chrome.tabs.query({ currentWindow: true }, (tabs) => { if (tabs.length < 2) { return; } - let select = (current + 1 + tabs.length) % tabs.length + let select = (current + count + tabs.length) % tabs.length let id = tabs[select].id; chrome.tabs.update(id, { active: true }) }); |