diff options
| -rw-r--r-- | CREDITS | 1 | ||||
| -rw-r--r-- | README.markdown | 1 | ||||
| -rw-r--r-- | background_scripts/main.coffee | 5 |
3 files changed, 6 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 (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/main.coffee b/background_scripts/main.coffee index e6951102..03c2277a 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -218,7 +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.duplicate(chrome.tabs.getCurrent(), (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") |
