diff options
Diffstat (limited to 'background_scripts')
| -rw-r--r-- | background_scripts/completion_engines.coffee | 13 | 
1 files changed, 13 insertions, 0 deletions
| 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  ] | 
