diff options
| author | Phil Crosby | 2013-02-17 23:36:10 -0800 |
|---|---|---|
| committer | Phil Crosby | 2013-02-17 23:36:10 -0800 |
| commit | 3e3ccbb5fc89af559dc67fd973abfe2cf1a2e5b8 (patch) | |
| tree | 4ec1eeed4ea1071dad23da6be6c661c79e65ae11 | |
| parent | c781ce942e225c9bc9f172cea54e0e7de6e4bcd0 (diff) | |
| parent | 275f52fd23b1185a1d63c0143e5e6dbea8b90a73 (diff) | |
| download | vimium-3e3ccbb5fc89af559dc67fd973abfe2cf1a2e5b8.tar.bz2 | |
Merge pull request #782 from deiga/patch-1
Added feature to duplicate current tab
| -rw-r--r-- | CREDITS | 1 | ||||
| -rw-r--r-- | README.markdown | 1 | ||||
| -rw-r--r-- | background_scripts/commands.coffee | 4 | ||||
| -rw-r--r-- | background_scripts/main.coffee | 4 |
4 files changed, 9 insertions, 1 deletions
@@ -38,5 +38,6 @@ Contributors: R.T. Lechow <rtlechow@gmail.com> (github: rtlechow) Wang Ning <daning106@gmail.com> (github:daning) Werner Laurensse (github: ab3) + Timo Sand <timo.j.sand@gmail.com> (github: deiga) Feel free to add real names in addition to GitHub usernames. diff --git a/README.markdown b/README.markdown index d0cabeed..94274ebf 100644 --- a/README.markdown +++ b/README.markdown @@ -70,6 +70,7 @@ Manipulating tabs: g0 go to the first tab g$ go to the last tab t create tab + yt duplicate current tab x close current tab X restore closed tab (i.e. unwind the 'x' command) T search through your open tabs diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee index d7c332f9..c6a3a770 100644 --- a/background_scripts/commands.coffee +++ b/background_scripts/commands.coffee @@ -98,7 +98,7 @@ Commands = historyNavigation: ["goBack", "goForward"] tabManipulation: - ["nextTab", "previousTab", "firstTab", "lastTab", "createTab", "removeTab", "restoreTab"] + ["nextTab", "previousTab", "firstTab", "lastTab", "createTab", "duplicateTab", "removeTab", "restoreTab"] misc: ["showHelp"] @@ -161,6 +161,7 @@ defaultKeyMappings = "g$": "lastTab" "t": "createTab" + "yt": "duplicateTab" "x": "removeTab" "X": "restoreTab" @@ -232,6 +233,7 @@ commandDescriptions = firstTab: ["Go to the first tab", { background: true }] lastTab: ["Go to the last tab", { background: true }] createTab: ["Create new tab", { background: true }] + duplicateTab: ["Duplicate current tab", { background: true }] removeTab: ["Close current tab", { background: true }] restoreTab: ["Restore closed tab", { background: true }] diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index d9229f12..03c2277a 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -218,6 +218,10 @@ repeatFunction = (func, totalCount, currentCount, frameId) -> # mapped in commands.coffee. BackgroundCommands = createTab: (callback) -> chrome.tabs.create({ url: "chrome://newtab" }, (tab) -> callback()) + duplicateTab: (callback) -> + chrome.tabs.getSelected(null, (tab) -> + chrome.tabs.duplicate(tab.id) + selectionChangedHandlers.push(callback)) nextTab: (callback) -> selectTab(callback, "next") previousTab: (callback) -> selectTab(callback, "previous") firstTab: (callback) -> selectTab(callback, "first") |
