aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts/completion_search.coffee
diff options
context:
space:
mode:
Diffstat (limited to 'background_scripts/completion_search.coffee')
-rw-r--r--background_scripts/completion_search.coffee7
1 files changed, 1 insertions, 6 deletions
diff --git a/background_scripts/completion_search.coffee b/background_scripts/completion_search.coffee
index d89eb278..cb819025 100644
--- a/background_scripts/completion_search.coffee
+++ b/background_scripts/completion_search.coffee
@@ -58,12 +58,7 @@ CompletionSearch =
return callback [] if 1 == queryTerms.length and Utils.isUrl query
return callback [] if Utils.hasJavascriptPrefix query
- # Cache completions. However, completions depend upon both the searchUrl and the query terms. So we need
- # to generate a key. We mix in some junk generated by pwgen. A key clash might be possible, but
- # is vanishingly unlikely.
- junk = "//Zi?ei5;o//"
- completionCacheKey = searchUrl + junk + queryTerms.map((s) -> s.toLowerCase()).join junk
-
+ completionCacheKey = JSON.stringify [ searchUrl, queryTerms ]
if @completionCache.has completionCacheKey
console.log "hit", completionCacheKey if @debug
return callback @completionCache.get completionCacheKey