diff options
| author | Stephen Blott | 2018-02-18 11:46:50 +0000 | 
|---|---|---|
| committer | GitHub | 2018-02-18 11:46:50 +0000 | 
| commit | c106c12add1667922d7778b243cd2e44065f7832 (patch) | |
| tree | a71d4ee48f520e9a8eb3780c44e108d75a144235 | |
| parent | 509d93f88112e0bfd0a47ac454e897156f00da14 (diff) | |
| parent | 6cef4caf7a21fdf7e8b52a6d8145d024c3ca6d19 (diff) | |
| download | vimium-c106c12add1667922d7778b243cd2e44065f7832.tar.bz2 | |
Merge pull request #2961 from smblott-github/javascript-URLs-for-custom-search-engines
Allow javascript: URLs for custom search engines.
| -rw-r--r-- | background_scripts/bg_utils.coffee | 3 | ||||
| -rw-r--r-- | pages/vomnibar.coffee | 1 | 
2 files changed, 3 insertions, 1 deletions
| diff --git a/background_scripts/bg_utils.coffee b/background_scripts/bg_utils.coffee index 698f5352..3fee6685 100644 --- a/background_scripts/bg_utils.coffee +++ b/background_scripts/bg_utils.coffee @@ -102,7 +102,8 @@ SearchEngines =              keyword = tokens[0].split(":")[0]              searchUrl = tokens[1]              description = tokens[2..].join(" ") || "search (#{keyword})" -            engines[keyword] = {keyword, searchUrl, description} if Utils.hasFullUrlPrefix searchUrl +            if Utils.hasFullUrlPrefix(searchUrl) or Utils.hasJavascriptPrefix searchUrl +              engines[keyword] = {keyword, searchUrl, description}          callback engines diff --git a/pages/vomnibar.coffee b/pages/vomnibar.coffee index c53e7170..01533b5f 100644 --- a/pages/vomnibar.coffee +++ b/pages/vomnibar.coffee @@ -167,6 +167,7 @@ class VomnibarUI          # avoid a race condition, we construct the query from the actual contents of the input (query).          query = Utils.createSearchUrl query, @lastReponse.engine.searchUrl if isCustomSearchPrimarySuggestion          @hide -> +          openInNewTab &&= not Utils.hasJavascriptPrefix query            chrome.runtime.sendMessage              handler: if openInNewTab then "openUrlInNewTab" else "openUrlInCurrentTab"              url: query | 
