diff options
| author | Stephen Blott | 2015-05-12 12:25:40 +0100 |
|---|---|---|
| committer | Stephen Blott | 2015-05-12 12:38:24 +0100 |
| commit | 851c34015053f2d774b626b674e19ad984f38a36 (patch) | |
| tree | a4ba04b73929c89fb4262cc4179637c0d7bdf9a7 /background_scripts | |
| parent | 16f978cab6542e7aaa932e1af87b9eec5c214b14 (diff) | |
| download | vimium-851c34015053f2d774b626b674e19ad984f38a36.tar.bz2 | |
Simplify and filter vomnibar URLs (tweaks).
Diffstat (limited to 'background_scripts')
| -rw-r--r-- | background_scripts/completion.coffee | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee index 3251f58a..819e8995 100644 --- a/background_scripts/completion.coffee +++ b/background_scripts/completion.coffee @@ -41,7 +41,6 @@ class Suggestion # or @relevancyFunction. @relevancy ?= @relevancyFunction this - # Note. This always returns a truthy value. generateHtml: -> return @html if @html relevancyHtml = if @showRelevancy then "<span class='relevancy'>#{@computeRelevancy()}</span>" else "" @@ -142,9 +141,12 @@ class Suggestion # - filter is a regexp; a URL must match this regexp first. # - replacements (itself a list) is a list of regexps, each of which is removed from matching URLs. # + # This includes some site-specific patterns for very-popular sites with URLs which don't work well in the + # vomnibar. + # stripPatterns: [ # Google search specific replacements; replaces query parameters which are known to not be helpful. - [ '^https?://www\.google\.(com|ca|com\.au|co\.uk|ie)/.*[&?]q=', + [ "^https?://www\.google\.(com|ca|com\.au|co\.uk|ie)/.*[&?]q=" "ei gws_rd url ved usg sa usg sig2".split(/\s+/).map (param) -> new RegExp "\&#{param}=[^&]+" ] # General replacements; replaces leading and trailing fluff. |
