diff options
| author | Stephen Blott | 2015-09-10 10:11:47 +0100 |
|---|---|---|
| committer | Stephen Blott | 2015-09-10 10:11:47 +0100 |
| commit | 92052d5cb9d0f190c47d985d0e35ec1944483dab (patch) | |
| tree | 82a13f5b17abe7c3354fdc5160ed332f93d153e5 | |
| parent | 2e0f80c2b4abd9ecfe3ff37f3c2d64d85edced35 (diff) | |
| parent | 3c1c4d44b0b7aec174f4d952c0a0d0bb2babf64c (diff) | |
| download | vimium-92052d5cb9d0f190c47d985d0e35ec1944483dab.tar.bz2 | |
Merge pull request #1811 from PrestanceDesign/feature/add-qwant-search-engine
Search completion; add support for Qwant completion
| -rw-r--r-- | CREDITS | 1 | ||||
| -rw-r--r-- | background_scripts/completion_engines.coffee | 13 | ||||
| -rw-r--r-- | lib/settings.coffee | 1 |
3 files changed, 15 insertions, 0 deletions
@@ -43,5 +43,6 @@ Contributors: Timo Sand <timo.j.sand@gmail.com> (github: deiga) Shiyong Chen <billbill290@gmail.com> (github: UncleBill) Utkarsh Upadhyay <musically.ut@gmail.com) (github: musically-ut) + Michael Salihi <admin@prestance-informatique.fr> (github: PrestanceDesign) Feel free to add real names in addition to GitHub usernames. diff --git a/background_scripts/completion_engines.coffee b/background_scripts/completion_engines.coffee index bdc93dba..5ec24ed6 100644 --- a/background_scripts/completion_engines.coffee +++ b/background_scripts/completion_engines.coffee @@ -140,6 +140,18 @@ class Webster extends BaseEngine parse: (xhr) -> JSON.parse(xhr.responseText).suggestions +class Qwant extends BaseEngine + constructor: -> + super + engineUrl: "https://api.qwant.com/api/suggest?q=%s" + regexps: "^https?://www\\.qwant\\.com/" + example: + searchUrl: "https://www.qwant.com/?q=%s" + keyword: "qw" + + parse: (xhr) -> + suggestion.value for suggestion in JSON.parse(xhr.responseText).data.items + # A dummy search engine which is guaranteed to match any search URL, but never produces completions. This # allows the rest of the logic to be written knowing that there will always be a completion engine match. class DummyCompletionEngine extends BaseEngine @@ -158,6 +170,7 @@ CompletionEngines = [ Bing Amazon Webster + Qwant DummyCompletionEngine ] diff --git a/lib/settings.coffee b/lib/settings.coffee index 26b034e8..dd1aa377 100644 --- a/lib/settings.coffee +++ b/lib/settings.coffee @@ -156,6 +156,7 @@ Settings = # b: https://www.bing.com/search?q=%s Bing # d: https://duckduckgo.com/?q=%s DuckDuckGo # az: http://www.amazon.com/s/?field-keywords=%s Amazon + # qw: https://www.qwant.com/?q=%s Qwant """ newTabUrl: "chrome://newtab" grabBackFocus: false |
