diff options
| author | Stephen Blott | 2015-05-02 15:19:20 +0100 |
|---|---|---|
| committer | Stephen Blott | 2015-05-02 15:19:20 +0100 |
| commit | 6073d820ff25f824b575a797f160b3204e0e9863 (patch) | |
| tree | fce658bb145cd558536fc79874af09f16045cd16 /background_scripts | |
| parent | 77d4e3b81b965eecb078db82bc92e747de1c371a (diff) | |
| download | vimium-6073d820ff25f824b575a797f160b3204e0e9863.tar.bz2 | |
Search completion; generalize Google regexp.
Diffstat (limited to 'background_scripts')
| -rw-r--r-- | background_scripts/search_engines.coffee | 12 |
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) -> |
