From b64ee6e26fedfd891b34d18eb84187da50163767 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Tue, 16 Dec 2014 15:06:12 +0000 Subject: URIEncode search engine queries. --- background_scripts/completion.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'background_scripts') diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee index dc5519d5..9d5f8780 100644 --- a/background_scripts/completion.coffee +++ b/background_scripts/completion.coffee @@ -327,7 +327,7 @@ class SearchEngineCompleter searchEngineMatch = this.getSearchEngineMatches(queryTerms[0]) suggestions = [] if searchEngineMatch - searchEngineMatch = searchEngineMatch.replace(/%s/g, queryTerms[1..].join(" ")) + searchEngineMatch = searchEngineMatch.replace(/%s/g, encodeURIComponent queryTerms[1..].join(" ")) suggestion = new Suggestion(queryTerms, "search", searchEngineMatch, queryTerms[0] + ": " + queryTerms[1..].join(" "), @computeRelevancy) suggestions.push(suggestion) onComplete(suggestions) -- cgit v1.2.3 From 652a301f70d43a1dc6ce44ae80c53af36e851945 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 28 Dec 2014 16:30:11 +0000 Subject: Use + as separator for search engines. --- background_scripts/completion.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'background_scripts') diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee index 9d5f8780..3b38faf8 100644 --- a/background_scripts/completion.coffee +++ b/background_scripts/completion.coffee @@ -327,7 +327,7 @@ class SearchEngineCompleter searchEngineMatch = this.getSearchEngineMatches(queryTerms[0]) suggestions = [] if searchEngineMatch - searchEngineMatch = searchEngineMatch.replace(/%s/g, encodeURIComponent queryTerms[1..].join(" ")) + searchEngineMatch = searchEngineMatch.replace(/%s/g, queryTerms[1..].join("+")) suggestion = new Suggestion(queryTerms, "search", searchEngineMatch, queryTerms[0] + ": " + queryTerms[1..].join(" "), @computeRelevancy) suggestions.push(suggestion) onComplete(suggestions) -- cgit v1.2.3 From b226510676e7229ae97d76187ffafda4979d8fe6 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 28 Dec 2014 17:03:38 +0000 Subject: Consistent treatment of search terms. --- background_scripts/completion.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'background_scripts') diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee index 3b38faf8..d62f82fe 100644 --- a/background_scripts/completion.coffee +++ b/background_scripts/completion.coffee @@ -327,7 +327,7 @@ class SearchEngineCompleter searchEngineMatch = this.getSearchEngineMatches(queryTerms[0]) suggestions = [] if searchEngineMatch - searchEngineMatch = searchEngineMatch.replace(/%s/g, queryTerms[1..].join("+")) + searchEngineMatch = searchEngineMatch.replace(/%s/g, Utils.createSearchQuery queryTerms[1..]) suggestion = new Suggestion(queryTerms, "search", searchEngineMatch, queryTerms[0] + ": " + queryTerms[1..].join(" "), @computeRelevancy) suggestions.push(suggestion) onComplete(suggestions) -- cgit v1.2.3