Vimium: Multi-word custom search with + separator breaks some engines

Created on 28 Jul 2017  路  5Comments  路  Source: philc/vimium

Issue

I've discovered the issue while using a custom search engine, Prisjakt. The issue persist on the UK version Pricespy. When replacing %s with the search terms provided, Vimium inserts a + (encoded: %2B) between all words. This is fine for many engines, but some, such as this, provides different results when using a space /%20 versus using a plus +/%2B.
And for this site, using spaces provides better search results than using plus-signs.

A similar issue has been raised previously in #1334, but the fix introduced in #1384 introduced the + that's creating this difference.

Steps to reproduce

  1. Add custom search engine Pricespy: p: https://pricespy.co.uk/#rparams=ss=%s Pricespy
  2. Search with p playstation 4 in the vomnibar
  3. Observe that the resulting search-query becomes playstation+4.
  4. Observe that changing it to playstation 4 changes the results (for the better).

Suggested solution 1

Use spaces (%20) as separators for search terms. Not sure how this will affect other search engines.

Suggested solution 2

Allow users to choose between tow searchterm variables: %s and %S, where one inserts plus-signs and the other spaces as separators.

Suggested solution 3

Allow users to specify a custom separator for their custom search engine, i.e. as p: https://pricespy.co.uk/#rparams=ss=%s ( ) Pricespy, where ( ) specifies the separator (here, spaces).

System information

  • OS: Windows 10 Pro 64bit v. 10.0.15063
  • Browser: Google Chrome 64bit v. 59.0.3071.115
  • Vimium: v. 1.59

Most helpful comment

Fixed in #3136.

All 5 comments

Suggested solution 1 is probably a non-starter; for sure it would break stuff for other users.

Solution 2 is an interesting idea.

Solution 3 seems most general.

Let's leave this for a bit and see if anybody else reports the same or similar issues.

You may try my Vimium++ (renamed to Vimium C) (https://chrome.google.com/webstore/detail/vimium-c/hfjbmagddngcpeloejdejnfgbamkjaeg), and it support %s or %S (aka $s, $S) to use + or (space) - %S means to concat URL using raw spaces.

Besides, it supports a simple "template" syntax:

  • $S{_} means to concat query words using _, and so does $S{/}
  • $S{$1/$2} means only to concat the first word and the second one using raw /, and $11, $12, ... are also OKay
  • $S{ + } to concat using (space)+(space)

For example, an engine of v.sum|sum\::聽vimium://eval\聽$S{\聽+\聽}聽re=聽Calculate allows you to get sum of all words by typing v.sum 1 2 3 4

@gdh1995 Yes, this might be exactly what I'm looking for! Thank you. I will give this a try, it seems to solve this particular problem perfectly.
I would prefer to use the official Vimium client, but if this becomes an issue I frequently run across I will consider a change.

I vote for Solution 2

Fixed in #3136.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kaldown picture kaldown  路  3Comments

umutyazgan picture umutyazgan  路  4Comments

Semro picture Semro  路  3Comments

bartlibert picture bartlibert  路  4Comments

finalfantasia picture finalfantasia  路  3Comments