diff options
| author | Stephen Blott | 2018-02-18 11:31:57 +0000 | 
|---|---|---|
| committer | Stephen Blott | 2018-02-18 11:36:51 +0000 | 
| commit | 6cef4caf7a21fdf7e8b52a6d8145d024c3ca6d19 (patch) | |
| tree | a71d4ee48f520e9a8eb3780c44e108d75a144235 /background_scripts/bg_utils.coffee | |
| parent | 509d93f88112e0bfd0a47ac454e897156f00da14 (diff) | |
| download | vimium-6cef4caf7a21fdf7e8b52a6d8145d024c3ca6d19.tar.bz2 | |
allow javascript: URLs for custom search engines.
For example, search the current site:
    cd: javascript:location='http://www.google.com/search?num=100&q=site:'+escape(location.hostname)+'+%s'
Apparently an example like this has been on the Wiki for four years, but
it has not been supported.
However, the change is so trivial that it's worth doing anyway.
Fixes #2956.
Diffstat (limited to 'background_scripts/bg_utils.coffee')
| -rw-r--r-- | background_scripts/bg_utils.coffee | 3 | 
1 files changed, 2 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 | 
