diff options
| author | Stephen Blott | 2015-05-16 13:57:45 +0100 |
|---|---|---|
| committer | Stephen Blott | 2015-05-16 13:57:48 +0100 |
| commit | 1d52e2df15a30c2d4df4482d18688a408ce32228 (patch) | |
| tree | 8008ee4f411ac89c0a0c8302f378c405d9f920ec | |
| parent | fdb41edfeb763cc4805e640ced7a576b7bebe02f (diff) | |
| download | vimium-1d52e2df15a30c2d4df4482d18688a408ce32228.tar.bz2 | |
Apply decodeURI when shortening URLs.
If the URL contains a query term such as vierwaldstättersee, then we
render the URL encoded version in the vomnibar. It looks considerably
nicer to render URL-decoded version.
| -rw-r--r-- | background_scripts/completion.coffee | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee index ee41aa07..5a47d8db 100644 --- a/background_scripts/completion.coffee +++ b/background_scripts/completion.coffee @@ -130,7 +130,13 @@ class Suggestion # Simplify a suggestion's URL (by removing those parts which aren't useful for display or comparison). shortenUrl: () -> return @shortUrl if @shortUrl? - url = @url + # We get easier-to-read shortened URLs if we URI-decode them. + url = + try + # decodeURI can raise an exception. + url = decodeURI @url + catch + @url for [ filter, replacements ] in @stripPatterns if new RegExp(filter).test url for replace in replacements |
