diff options
| author | mrmr1993 | 2017-09-21 21:46:39 +0100 |
|---|---|---|
| committer | mrmr1993 | 2017-09-21 21:46:39 +0100 |
| commit | 7fa22da6954d28dbd578b0cd490ada638d98b373 (patch) | |
| tree | 0e72947e9adf112caf4b13bf125a2e79907524cd /background_scripts | |
| parent | a8337e93b33cfbaba17c4a237fe7330f27145c0c (diff) | |
| download | vimium-7fa22da6954d28dbd578b0cd490ada638d98b373.tar.bz2 | |
Add openUrlInNewWindow command
Diffstat (limited to 'background_scripts')
| -rw-r--r-- | background_scripts/main.coffee | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index eeda263a..8afecd4f 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -117,6 +117,16 @@ TabOperations = catch callback.apply this, arguments + # Opens request.url in new window and switches to it. + openUrlInNewWindow: (request, callback = (->)) -> + winConfig = + url: Utils.convertToUrl request.url + active: true + winConfig.active = request.active if request.active? + # Firefox does not support "about:newtab" in chrome.tabs.create. + delete tabConfig["url"] if tabConfig["url"] == Settings.defaults.newTabUrl + chrome.windows.create winConfig, callback + toggleMuteTab = do -> muteTab = (tab) -> chrome.tabs.update tab.id, {muted: !tab.mutedInfo.muted} @@ -416,6 +426,7 @@ sendRequestHandlers = # with Chrome-specific URLs like "view-source:http:..". getCurrentTabUrl: ({tab}) -> tab.url openUrlInNewTab: (request) -> TabOperations.openUrlInNewTab request + openUrlInNewWindow: (request) -> TabOperations.openUrlInNewWindow request openUrlInIncognito: (request) -> chrome.windows.create incognito: true, url: Utils.convertToUrl request.url openUrlInCurrentTab: TabOperations.openUrlInCurrentTab openOptionsPageInNewTab: (request) -> |
