aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts/main.coffee
diff options
context:
space:
mode:
Diffstat (limited to 'background_scripts/main.coffee')
-rw-r--r--background_scripts/main.coffee9
1 files changed, 5 insertions, 4 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee
index 3eb8ef76..4964b73c 100644
--- a/background_scripts/main.coffee
+++ b/background_scripts/main.coffee
@@ -270,10 +270,11 @@ BackgroundCommands =
# "pages/blank.html" does not work in incognito mode, so fall back to "chrome://newtab" instead.
url = if tab.incognito then "chrome://newtab" else chrome.runtime.getURL url
TabOperations.openUrlInNewTab { url }, callback
- duplicateTab: (callback) ->
- chrome.tabs.getSelected(null, (tab) ->
- chrome.tabs.duplicate(tab.id)
- selectionChangedHandlers.push(callback))
+ duplicateTab: (count) ->
+ chrome.tabs.getSelected null, (tab) ->
+ createTab = (tab) ->
+ chrome.tabs.duplicate tab.id, createTab if 0 < count--
+ createTab tab
moveTabToNewWindow: (count) ->
chrome.tabs.query {currentWindow: true}, (tabs) ->
chrome.tabs.query {currentWindow: true, active: true}, (activeTabs) ->