From 06df48e113f9a31238fcdddd30db6b60af6aa1b4 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Tue, 2 Jun 2015 15:32:08 +0100 Subject: De-duplicate Google Maps URLs in vomnibar. In Google Maps, we get a new history entry for every pan and every zoom. This removes such duplicates. --- background_scripts/completion.coffee | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'background_scripts') diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee index c83066a6..0fe95cf1 100644 --- a/background_scripts/completion.coffee +++ b/background_scripts/completion.coffee @@ -166,10 +166,14 @@ class Suggestion stripPatterns: [ # Google search specific replacements; this replaces query parameters which are known to not be helpful. # There's some additional information here: http://www.teknoids.net/content/google-search-parameters-2012 - [ "^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 bih biw cd aqs ie sourceid es_sm" .split(/\s+/).map (param) -> new RegExp "\&#{param}=[^&]+" ] + # On Google maps, we get a new history entry for every pan and zoom event. + [ "^https?://www\\.google\\.(com|ca|com\\.au|co\\.uk|ie)/maps/place/.*/@" + [ new RegExp "/@.*" ] ] + # General replacements; replaces leading and trailing fluff. [ '.', [ "^https?://", "\\W+$" ].map (re) -> new RegExp re ] ] -- cgit v1.2.3