[Vimperator] v0.4 search engines integration problems
Martin Stubenschrott
stubenschrott at gmx.net
Fri May 4 05:53:51 PDT 2007
On Fri, May 04, 2007 at 12:25:43PM +0100, Pierre Andrews wrote:
> there seems to be some bugs with how vimperator 0.4 integrates with
> the firefox search engines. A problem has already been mentioned
> earlier. Here are two obvervations I've made:
>
> The keyword for the search provided by vimperator is only the first
> "word" of the search engine name. This result in "wikipedia english"
> and "wikipedia french" in havint the same "wikipedia" keywords. I also
> have a "flickr groups" and "flickr photos" that both have a "flickr"
> search keyworkd because of that. It's also a bit strange with other
> engines, like for example "le conjugueur" has the keyword "le" which
> is only an article ("the") so has not much meanings.
> A temporary solution to that is to go in your profile folder in the
> searchplugins subfolder and edit the search engine files to change the
> engine names.
>
> Probably here, a fix would be to replace the non word characters with
> a '_', line 165 of bookmarks.js, something like:
> var alias = firefox_engines[i].name.replace(/\W+/g,
> "_").toLowerCase();
>
> Another solution would be to define the search engines with the
> "keyword on bookmarks", but that doesn't seem to be supported by
> vimperator yet.
I thought about just replacing non-word chars with _ but most search
engines look stupid then. So I thought of either:
1.) If there is already such a quicksearch name, only then I will use the
full name, otherwise just one word
2.) make the aliases user-configurable somehow, but I don't know the
best ui for it.
> The second, very annoying problem I have found, is that if I type:
> :open google.com/ig
> or
> :open flickr.com/photos/me
>
> instead of opening the web site, it opens the search engine for a
> search (respectively) for ".com/ig" and ".com/photos/me". Shouldn't
> vimperator wait for a space there?
> I think that this problem comes from line 1316 of commands.js The
> regexp should probably be (not tested):
> var matches = urls[url].match(/^\s*(\w+)(\s+(.*)|$)/);
> the second \s takes a + so that we get at least 1 space after the
> engine name, or we are at the end (I am not sure javascript works with
> this kind of regexp, but that's the idea I suppose)
The second problem is fixed in 0.4.1 which is on the homepage (but not
auto installed by firefox).
More information about the Vimperator
mailing list