aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts
diff options
context:
space:
mode:
Diffstat (limited to 'background_scripts')
-rw-r--r--background_scripts/completion.coffee16
1 files changed, 8 insertions, 8 deletions
diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee
index 94109b84..024ea54c 100644
--- a/background_scripts/completion.coffee
+++ b/background_scripts/completion.coffee
@@ -355,11 +355,14 @@ class TabCompleter
tabRecency.recencyScore(suggestion.tabId)
class SearchEngineCompleter
- searchEngineConfig: null
+ searchEngines: null
+
+ cancel: ->
+ CompletionEngines.cancel()
refresh: (port) ->
# Load and parse the search-engine configuration.
- @searchEngineConfig = new AsyncDataFetcher (callback) ->
+ @searchEngines = new AsyncDataFetcher (callback) ->
engines = {}
for line in Settings.get("searchEngines").split "\n"
line = line.trim()
@@ -373,18 +376,18 @@ class SearchEngineCompleter
searchUrl: tokens[1]
description: description
- # Deliver the resulting engines lookup table.
+ # Deliver the resulting engines AsyncDataFetcher lookup table.
callback engines
# Let the vomnibar know the custom search engine keywords.
port.postMessage
- handler: "customSearchEngineKeywords"
+ handler: "keywords"
keywords: key for own key of engines
filter: ({ queryTerms, query }, onComplete) ->
return onComplete [] if queryTerms.length == 0
- @searchEngineConfig.use (engines) =>
+ @searchEngines.use (engines) =>
keyword = queryTerms[0]
{ custom, searchUrl, description, queryTerms } =
@@ -482,9 +485,6 @@ class SearchEngineCompleter
count = Math.min 6, Math.max 3, MultiCompleter.maxResults - existingSuggestions.length
onComplete suggestions[...count]
- cancel: ->
- CompletionEngines.cancel()
-
# A completer which calls filter() on many completers, aggregates the results, ranks them, and returns the top
# 10. Queries from the vomnibar frontend script come through a multi completer.
class MultiCompleter