From c4de9ec451f781fa0cc6ce2cd82982d5d66ef787 Mon Sep 17 00:00:00 2001 From: usk Date: Sat, 4 Nov 2017 07:38:51 +0900 Subject: add support for duplicating current tab --- src/background/actions/operation.js | 2 ++ src/background/tabs.js | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src/background') diff --git a/src/background/actions/operation.js b/src/background/actions/operation.js index d0caf80..9876940 100644 --- a/src/background/actions/operation.js +++ b/src/background/actions/operation.js @@ -35,6 +35,8 @@ const exec = (operation, tab) => { 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: diff --git a/src/background/tabs.js b/src/background/tabs.js index 23b3b7b..d641616 100644 --- a/src/background/tabs.js +++ b/src/background/tabs.js @@ -111,8 +111,12 @@ const toggleTabPinned = (current) => { updateTabPinned(current, !current.pinned); }; +const duplicate = (id) => { + return browser.tabs.duplicate(id); +}; + export { closeTab, reopenTab, selectAt, selectByKeyword, getCompletions, selectPrevTab, selectNextTab, selectFirstTab, selectLastTab, reload, - updateTabPinned, toggleTabPinned + updateTabPinned, toggleTabPinned, duplicate }; -- cgit v1.2.3