diff --git a/README.md b/README.md index 2d34a06..e8a9835 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ The default mappings are as follows: - r: reload current tab - R: reload current tab without cache - zp: toggle pin/unpin current tab +- zd: duplicate current tab ### Navigation - f: start following links in the page 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 }; diff --git a/src/shared/default-settings.js b/src/shared/default-settings.js index e45bee6..14f48be 100644 --- a/src/shared/default-settings.js +++ b/src/shared/default-settings.js @@ -33,6 +33,7 @@ export default { "r": { "type": "tabs.reload", "cache": false }, "R": { "type": "tabs.reload", "cache": true }, "zp": { "type": "tabs.pin.toggle" }, + "zd": { "type": "tabs.duplicate" }, "zi": { "type": "zoom.in" }, "zo": { "type": "zoom.out" }, "zz": { "type": "zoom.neutral" }, diff --git a/src/shared/operations.js b/src/shared/operations.js index 1aa4227..f63f7ca 100644 --- a/src/shared/operations.js +++ b/src/shared/operations.js @@ -42,6 +42,7 @@ export default { TAB_PIN: 'tabs.pin', TAB_UNPIN: 'tabs.unpin', TAB_TOGGLE_PINNED: 'tabs.pin.toggle', + TAB_DUPLICATE: 'tabs.duplicate', // Zooms ZOOM_IN: 'zoom.in',