aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts
diff options
context:
space:
mode:
authorStephen Blott2015-05-31 08:13:52 +0100
committerStephen Blott2015-05-31 13:31:16 +0100
commit10b9f1bccf8728a43b70bd09628d8de1d2b435ae (patch)
tree09547549296b0fe97f73b0f9b8c1d16c44dbf550 /background_scripts
parent51bce3aedffc65c74daee3cc64205730b083dfdd (diff)
downloadvimium-10b9f1bccf8728a43b70bd09628d8de1d2b435ae.tar.bz2
Fix completion engine regular expressions.
We need to use "\\." to get a literal ".".
Diffstat (limited to 'background_scripts')
-rw-r--r--background_scripts/completion_engines.coffee14
1 files changed, 7 insertions, 7 deletions
diff --git a/background_scripts/completion_engines.coffee b/background_scripts/completion_engines.coffee
index f15e6db4..638be27a 100644
--- a/background_scripts/completion_engines.coffee
+++ b/background_scripts/completion_engines.coffee
@@ -34,7 +34,7 @@ class GoogleXMLRegexpEngine extends RegexpEngine
class Google extends GoogleXMLRegexpEngine
# Example search URL: http://www.google.com/search?q=%s
constructor: (regexps = null) ->
- super regexps ? "^https?://[a-z]+\.google\.(com|ie|co\.uk|ca|com\.au)/"
+ super regexps ? "^https?://[a-z]+\\.google\\.(com|ie|co\\.uk|ca|com\\.au)/"
getUrl: (queryTerms) ->
Utils.createSearchUrl queryTerms,
@@ -59,12 +59,12 @@ class GoogleWithPrefix
# then strip "map of" from the resulting suggestions.
class GoogleMaps extends GoogleWithPrefix
# Example search URL: https://www.google.com/maps?q=%s
- constructor: -> super "map of", "https?://[a-z]+\.google\.(com|ie|co\.uk|ca|com\.au)/maps"
+ constructor: -> super "map of", "https?://[a-z]+\\.google\\.(com|ie|co\\.uk|ca|com\\.au)/maps"
class Youtube extends GoogleXMLRegexpEngine
# Example search URL: http://www.youtube.com/results?search_query=%s
constructor: ->
- super "^https?://[a-z]+\.youtube\.com/results"
+ super "^https?://[a-z]+\\.youtube\\.com/results"
getUrl: (queryTerms) ->
Utils.createSearchUrl queryTerms,
@@ -73,7 +73,7 @@ class Youtube extends GoogleXMLRegexpEngine
class Wikipedia extends RegexpEngine
# Example search URL: http://www.wikipedia.org/w/index.php?title=Special:Search&search=%s
constructor: ->
- super "^https?://[a-z]+\.wikipedia\.org/"
+ super "^https?://[a-z]+\\.wikipedia\\.org/"
getUrl: (queryTerms) ->
Utils.createSearchUrl queryTerms,
@@ -84,13 +84,13 @@ class Wikipedia extends RegexpEngine
class Bing extends RegexpEngine
# Example search URL: https://www.bing.com/search?q=%s
- constructor: -> super "^https?://www\.bing\.com/search"
+ constructor: -> super "^https?://www\\.bing\\.com/search"
getUrl: (queryTerms) -> Utils.createSearchUrl queryTerms, "http://api.bing.com/osjson.aspx?query=%s"
parse: (xhr) -> JSON.parse(xhr.responseText)[1]
class Amazon extends RegexpEngine
# Example search URL: http://www.amazon.com/s/?field-keywords=%s
- constructor: -> super "^https?://www\.amazon\.(com|co.uk|ca|com.au)/s/"
+ constructor: -> super "^https?://www\\.amazon\\.(com|co\\.uk|ca|com\\.au)/s/"
getUrl: (queryTerms) ->
Utils.createSearchUrl queryTerms,
"https://completion.amazon.com/search/complete?method=completion&search-alias=aps&client=amazon-search-ui&mkt=1&q=%s"
@@ -98,7 +98,7 @@ class Amazon extends RegexpEngine
class DuckDuckGo extends RegexpEngine
# Example search URL: https://duckduckgo.com/?q=%s
- constructor: -> super "^https?://([a-z]+\.)?duckduckgo\.com/"
+ constructor: -> super "^https?://([a-z]+\\.)?duckduckgo\\.com/"
getUrl: (queryTerms) -> Utils.createSearchUrl queryTerms, "https://duckduckgo.com/ac/?q=%s"
parse: (xhr) ->
suggestion.phrase for suggestion in JSON.parse xhr.responseText