diff options
| author | Sudarshan Wadkar | 2015-03-01 14:42:40 -0500 |
|---|---|---|
| committer | Sudarshan Wadkar | 2015-03-01 14:42:40 -0500 |
| commit | 6901f4e584a41501ea865b87c481dc089a8f0d6f (patch) | |
| tree | 8360c05bbde3cc4e81b7eb53c999dff8fe729fe7 | |
| parent | e2e311fd8e422ec9de50a92566ff14a2a76fe74f (diff) | |
| download | vimium-6901f4e584a41501ea865b87c481dc089a8f0d6f.tar.bz2 | |
Stick in callback so `Nt` works
- This fix enables `2t` to open two new tabs, even in incognito.
Include callback in the call chain so that numbered commands can work.
| -rw-r--r-- | background_scripts/main.coffee | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index a7dbeca8..aa46dec0 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -163,9 +163,10 @@ openUrlInCurrentTab = (request) -> # # Opens request.url in new tab and switches to it if request.selected is true. # -openUrlInNewTab = (request) -> +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 })) + chrome.tabs.create({ url: Utils.convertToUrl(request.url), index: tab.index + 1, selected: true, windowId: tab.windowId }, + (tab) -> callback())) openUrlInIncognito = (request) -> chrome.windows.create({ url: Utils.convertToUrl(request.url), incognito: true}) @@ -231,7 +232,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") }) + createTab: (callback) -> openUrlInNewTab({ url: Settings.get("newTabUrl") }, (tab) -> callback()) duplicateTab: (callback) -> chrome.tabs.getSelected(null, (tab) -> chrome.tabs.duplicate(tab.id) |
