diff options
| author | Pavel Yarmak | 2017-10-07 15:07:55 -0500 |
|---|---|---|
| committer | Pavel Yarmak | 2017-10-07 15:07:55 -0500 |
| commit | 2480acdf64b690d73d2ac20ca6c865ca8d83024a (patch) | |
| tree | 093da068294065df88eb780adc76a864cce36cfa /background_scripts | |
| parent | 27691f8c4dcdecdb884349189966eb6e2667330e (diff) | |
| download | vimium-2480acdf64b690d73d2ac20ca6c865ca8d83024a.tar.bz2 | |
Added UpToDate autocompletion engine
Diffstat (limited to 'background_scripts')
| -rw-r--r-- | background_scripts/completion_engines.coffee | 12 |
1 files changed, 12 insertions, 0 deletions
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 ] |
