From ed863f6fa4cd1006c31f60edb3ad0639c6983e37 Mon Sep 17 00:00:00 2001 From: Michael SALIHI Date: Thu, 10 Sep 2015 07:34:00 +0200 Subject: Search completion; add support for Qwant completion --- background_scripts/completion_engines.coffee | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'background_scripts/completion_engines.coffee') diff --git a/background_scripts/completion_engines.coffee b/background_scripts/completion_engines.coffee index b572375d..6c2fbf8d 100644 --- a/background_scripts/completion_engines.coffee +++ b/background_scripts/completion_engines.coffee @@ -140,6 +140,17 @@ 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) -> JSON.parse(xhr.responseText)[1] + # 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 +169,7 @@ CompletionEngines = [ Bing Amazon Webster + Qwant DummyCompletionEngine ] -- cgit v1.2.3