aboutsummaryrefslogtreecommitdiff
path: root/src/background
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2017-11-06 21:45:02 +0000
committerGitHub <noreply@github.com>2017-11-06 21:45:02 +0000
commit86b534b1e1de03d51efb9f28cd32296d037f07fc (patch)
tree965171f72c09aa3927d020e117b42811e908e160 /src/background
parent256820f78d0450c55a32557eca13294ab9fdf80f (diff)
parentc4de9ec451f781fa0cc6ce2cd82982d5d66ef787 (diff)
Merge pull request #131 from usk/duplicating-current-tab
add support for duplicating current tab
Diffstat (limited to 'src/background')
-rw-r--r--src/background/actions/operation.js2
-rw-r--r--src/background/tabs.js6
2 files changed, 7 insertions, 1 deletions
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
};