aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts
diff options
context:
space:
mode:
authorStephen Blott2015-03-05 06:32:39 +0000
committerStephen Blott2015-03-05 06:32:39 +0000
commit67abd209027d7150e104cab8004a3b924f6053d8 (patch)
treec029315926e0cda55535d912af9c2157f9fa3f89 /background_scripts
parent6901f4e584a41501ea865b87c481dc089a8f0d6f (diff)
downloadvimium-67abd209027d7150e104cab8004a3b924f6053d8.tar.bz2
Tidy up #1507.
Diffstat (limited to 'background_scripts')
-rw-r--r--background_scripts/main.coffee12
1 files changed, 8 insertions, 4 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee
index aa46dec0..a217ad91 100644
--- a/background_scripts/main.coffee
+++ b/background_scripts/main.coffee
@@ -164,9 +164,13 @@ openUrlInCurrentTab = (request) ->
# Opens request.url in new tab and switches to it if request.selected is true.
#
openUrlInNewTab = (request, callback) ->
- chrome.tabs.getSelected(null, (tab) ->
- chrome.tabs.create({ url: Utils.convertToUrl(request.url), index: tab.index + 1, selected: true, windowId: tab.windowId },
- (tab) -> callback()))
+ chrome.tabs.getSelected null, (tab) ->
+ tabConfig =
+ url: Utils.convertToUrl request.url
+ index: tab.index + 1
+ selected: true
+ windowId: tab.windowId
+ chrome.tabs.create tabConfig, callback
openUrlInIncognito = (request) ->
chrome.windows.create({ url: Utils.convertToUrl(request.url), incognito: true})
@@ -232,7 +236,7 @@ moveTab = (callback, direction) ->
# These are commands which are bound to keystroke which must be handled by the background page. They are
# mapped in commands.coffee.
BackgroundCommands =
- createTab: (callback) -> openUrlInNewTab({ url: Settings.get("newTabUrl") }, (tab) -> callback())
+ createTab: (callback) -> openUrlInNewTab { url: Settings.get("newTabUrl") }, callback
duplicateTab: (callback) ->
chrome.tabs.getSelected(null, (tab) ->
chrome.tabs.duplicate(tab.id)