diff options
| -rw-r--r-- | CREDITS | 1 | ||||
| -rw-r--r-- | README.markdown | 1 | ||||
| -rw-r--r-- | background_page.html | 10 | ||||
| -rw-r--r-- | manifest.json | 2 | ||||
| -rw-r--r-- | vimiumFrontend.js | 2 | 
5 files changed, 14 insertions, 2 deletions
| @@ -11,6 +11,7 @@ Contributors:    drizzd    int3    Johannes Emerich (github: knuton) +  Julian Naydichev <rublind@gmail.com> (github: naydichev)    lack    markstos    rodimius diff --git a/README.markdown b/README.markdown index 04e7375d..3a9352ca 100644 --- a/README.markdown +++ b/README.markdown @@ -87,6 +87,7 @@ Release Notes  1.22  -  Some sites are now excluded by default. +-  View source (`gs`) now opens in a new tab.  -  Bugfixes.  1.21 (10/24/2010) diff --git a/background_page.html b/background_page.html index ff25610b..106db28d 100644 --- a/background_page.html +++ b/background_page.html @@ -71,6 +71,7 @@    var sendRequestHandlers = {      getCompletionKeys: getCompletionKeys,      getLinkHintCss: getLinkHintCss, +    openUrlInNewTab: openUrlInNewTab,      openUrlInCurrentTab: openUrlInCurrentTab,      openOptionsPageInNewTab: openOptionsPageInNewTab,      registerFrame: registerFrame, @@ -238,6 +239,15 @@       });     } +  /** +   * Opens request.url in new tab and switches to it if request.selected is true. +   * +   */ +  function openUrlInNewTab(request) { +    chrome.tabs.getSelected(null, function(tab) { +      chrome.tabs.create({ url: request.url, index: tab.index + 1, selected: request.selected }); +    }); +  }    /*     * Returns the core CSS used for link hints, along with any user-provided overrides.     */ diff --git a/manifest.json b/manifest.json index 0459a80b..161bdb30 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@  {    "name": "Vimium", -  "version": "1.21", +  "version": "1.22",    "description": "The Hacker's Browser. Vimium provides keyboard shortcuts for navigation and control in the spirit of Vim.",    "icons": {  "16": "icons/icon16.png",                "48": "icons/icon48.png", diff --git a/vimiumFrontend.js b/vimiumFrontend.js index c808406c..e5e214f7 100644 --- a/vimiumFrontend.js +++ b/vimiumFrontend.js @@ -336,7 +336,7 @@ function toggleViewSourceCallback(url) {      url = url.substr(12, url.length - 12);    }    else { url = "view-source:" + url; } -  chrome.extension.sendRequest({handler: "openUrlInCurrentTab", url:url}); +  chrome.extension.sendRequest({handler: "openUrlInNewTab", url: url, selected: true});  }  /** | 
