aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts
diff options
context:
space:
mode:
authorStephen Blott2015-05-02 15:19:20 +0100
committerStephen Blott2015-05-02 15:19:20 +0100
commit6073d820ff25f824b575a797f160b3204e0e9863 (patch)
treefce658bb145cd558536fc79874af09f16045cd16 /background_scripts
parent77d4e3b81b965eecb078db82bc92e747de1c371a (diff)
downloadvimium-6073d820ff25f824b575a797f160b3204e0e9863.tar.bz2
Search completion; generalize Google regexp.
Diffstat (limited to 'background_scripts')
-rw-r--r--background_scripts/search_engines.coffee12
1 files changed, 9 insertions, 3 deletions
diff --git a/background_scripts/search_engines.coffee b/background_scripts/search_engines.coffee
index f07a9df4..e96e2c76 100644
--- a/background_scripts/search_engines.coffee
+++ b/background_scripts/search_engines.coffee
@@ -7,11 +7,17 @@
#
class Google
constructor: ->
+ @regexps = [
+ # We include matches for the major English-speaking TLDs.
+ new RegExp "^https?://[a-z]+\.google\.(com|ie|co.uk|ca|com.au)/"
+ # NOTE(smblott). A temporary hack, just for me, and just for development. Will be removed.
+ new RegExp "localhost/.*/booky"
+ ]
+
name: "Google"
match: (searchUrl) ->
- return true if /^https?:\/\/[a-z]+.google.com\//.test searchUrl
- # NOTE(smblott). A temporary hack, just for me, and just for development. Will be removed.
- return true if /localhost\/.*\/booky/.test searchUrl
+ for re in @regexps
+ return true if re.test searchUrl
false
getUrl: (queryTerms) ->