diff options
| author | Stephen Blott | 2017-11-24 12:27:36 +0000 |
|---|---|---|
| committer | GitHub | 2017-11-24 12:27:36 +0000 |
| commit | e656801773a1feeb836f5f3c0e220b1585066015 (patch) | |
| tree | 334ad3a27f7cb4ec9ca5d6a586791bc36e75c7e6 /background_scripts | |
| parent | 138a7b00d2458d34fdea4c00ae59f7bbfdc57c6f (diff) | |
| parent | 18b3419ad43ed06b88f26b30487002da4866b92d (diff) | |
| download | vimium-e656801773a1feeb836f5f3c0e220b1585066015.tar.bz2 | |
Merge pull request #2836 from smblott-github/add-createTab-options
Add window and incognito options for createTab.
Diffstat (limited to 'background_scripts')
| -rw-r--r-- | background_scripts/main.coffee | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index 8f095ef1..4e36907a 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -188,13 +188,20 @@ BackgroundCommands = [if request.tab.incognito then "chrome://newtab" else chrome.runtime.getURL newTabUrl] else [newTabUrl] - urls = request.urls[..].reverse() - do openNextUrl = (request) -> - if 0 < urls.length - TabOperations.openUrlInNewTab (extend request, {url: urls.pop()}), (tab) -> - openNextUrl extend request, {tab, tabId: tab.id} - else - callback request + if request.registryEntry.options.incognito or request.registryEntry.options.window + windowConfig = + url: request.urls + focused: true + incognito: request.registryEntry.options.incognito ? false + chrome.windows.create windowConfig, -> callback request + else + urls = request.urls[..].reverse() + do openNextUrl = (request) -> + if 0 < urls.length + TabOperations.openUrlInNewTab (extend request, {url: urls.pop()}), (tab) -> + openNextUrl extend request, {tab, tabId: tab.id} + else + callback request duplicateTab: mkRepeatCommand (request, callback) -> chrome.tabs.duplicate request.tabId, (tab) -> callback extend request, {tab, tabId: tab.id} moveTabToNewWindow: ({count, tab}) -> |
