aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRyan Perry-Nguyen2018-09-14 13:13:20 -0400
committerRyan Perry-Nguyen2018-09-14 13:13:20 -0400
commit2ee06443f4cfc72445625c2a09238866a82059f5 (patch)
tree7c8d5f840f9e184f652c71e2766d68d91dfd9965 /lib
parent880b64b0caeb73b0803034f4a27bde78c66d2eaa (diff)
downloadvimium-2ee06443f4cfc72445625c2a09238866a82059f5.tar.bz2
dont queries for %S replacement
Diffstat (limited to 'lib')
-rw-r--r--lib/utils.coffee3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/utils.coffee b/lib/utils.coffee
index 6f38be8f..45a880e5 100644
--- a/lib/utils.coffee
+++ b/lib/utils.coffee
@@ -131,7 +131,8 @@ Utils =
# It would be better to pull the default search engine from chrome itself. However, chrome does not provide
# an API for doing so.
createSearchUrl: (query, searchUrl = Settings.get("searchUrl")) ->
- searchUrl += "%s" unless 0 <= searchUrl.indexOf "%s"
+ searchUrl += "%s" if -1 == searchUrl.indexOf("%s") + searchUrl.indexOf("%S")
+ searchUrl = searchUrl.replace /%S/g, query
searchUrl.replace /%s/g, @createSearchQuery query
# Extract a query from url if it appears to be a URL created from the given search URL.