From 9b0c37c755fd964edf02271f9051f0f6e33e2431 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 17 May 2015 14:10:40 +0100 Subject: use a less brittle approach to decoding URIs. --- background_scripts/completion.coffee | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'background_scripts') diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee index 11c63cf0..56740efd 100644 --- a/background_scripts/completion.coffee +++ b/background_scripts/completion.coffee @@ -131,13 +131,7 @@ class Suggestion shortenUrl: () -> return @shortUrl if @shortUrl? # We get easier-to-read shortened URLs if we URI-decode them. - url = - try - # decodeURI can raise an exception. - url = decodeURI @url - catch - @url - url = url.toLowerCase() + url = (Utils.decodeURIByParts(@url) || @url).toLowerCase() for [ filter, replacements ] in @stripPatterns if new RegExp(filter).test url for replace in replacements -- cgit v1.2.3