From 2480acdf64b690d73d2ac20ca6c865ca8d83024a Mon Sep 17 00:00:00 2001 From: Pavel Yarmak Date: Sat, 7 Oct 2017 15:07:55 -0500 Subject: Added UpToDate autocompletion engine --- background_scripts/completion_engines.coffee | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/background_scripts/completion_engines.coffee b/background_scripts/completion_engines.coffee index 0a53ad14..a6ff6dc3 100644 --- a/background_scripts/completion_engines.coffee +++ b/background_scripts/completion_engines.coffee @@ -163,6 +163,17 @@ class Qwant extends BaseEngine parse: (xhr) -> suggestion.value for suggestion in JSON.parse(xhr.responseText).data.items +class UpToDate extends BaseEngine + constructor: -> + super + engineUrl: "https://www.uptodate.com/services/app/contents/search/autocomplete/json?term=%s&limit=10" + regexps: "^https?://www\\.uptodate\\.com/" + example: + searchUrl: "https://www.uptodate.com/contents/search?search=%s&searchType=PLAIN_TEXT&source=USER_INPUT&searchControl=TOP_PULLDOWN&autoComplete=false" + keyword: "upto" + + parse: (xhr) -> JSON.parse(xhr.responseText).data.searchTerms + # 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 @@ -183,6 +194,7 @@ CompletionEngines = [ AmazonJapan Webster Qwant + UpToDate DummyCompletionEngine ] -- cgit v1.2.3