diff options
Diffstat (limited to 'src/background/actions/operation.js')
-rw-r--r-- | src/background/actions/operation.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/background/actions/operation.js b/src/background/actions/operation.js index b94c117..1e4990c 100644 --- a/src/background/actions/operation.js +++ b/src/background/actions/operation.js @@ -10,6 +10,9 @@ const sendConsoleShowCommand = (tab, command) => { }); }; +// This switch statement is only gonna get longer as more +// features are added, so disable complexity check +/* eslint-disable complexity */ const exec = (operation, tab) => { switch (operation.type) { case operations.TAB_CLOSE: @@ -20,8 +23,20 @@ const exec = (operation, tab) => { return tabs.selectPrevTab(tab.index, operation.count); case operations.TAB_NEXT: return tabs.selectNextTab(tab.index, operation.count); + case operations.TAB_FIRST: + return tabs.selectFirstTab(); + case operations.TAB_LAST: + return tabs.selectLastTab(); case operations.TAB_RELOAD: return tabs.reload(tab, operation.cache); + case operations.TAB_PIN: + return tabs.updateTabPinned(tab, true); + case operations.TAB_UNPIN: + return tabs.updateTabPinned(tab, false); + case operations.TAB_TOGGLE_PINNED: + return tabs.toggleTabPinned(tab); + case operations.TAB_DUPLICATE: + return tabs.duplicate(tab.id); case operations.ZOOM_IN: return zooms.zoomIn(); case operations.ZOOM_OUT: @@ -50,9 +65,14 @@ const exec = (operation, tab) => { return sendConsoleShowCommand(tab, 'winopen '); case operations.COMMAND_SHOW_BUFFER: return sendConsoleShowCommand(tab, 'buffer '); + case operations.FIND_START: + return browser.tabs.sendMessage(tab.id, { + type: messages.CONSOLE_SHOW_FIND + }); default: return Promise.resolve(); } }; +/* eslint-enable complexity */ export { exec }; |