[Vimperator] Addon search keywords
Martin Stubenschrott
stubenschrott at gmx.net
Mon Jun 9 16:06:46 PDT 2008
Kipling Inscore wrote:
> So I see Vimperator checks the search aliases followed by bookmark shortcuts.
> Turns out the del.icio.us addon overrides getShortcutOrURI so its
> shortcuts don't show up in either of these services.
Good investiagtion.
>> method for Vimperator 1.x. I'll be working on a patch, particularly to
>> support del.icio.us bookmark shortcuts through the official
>> del.icio.us addon, so guidance on where I should be looking or whether
>> I should be doing this would be appreciated.
If possible, i think the best way to do del.icio.us integration would be
to do a vimperator plugin.
> Below is a patch against Vimperator CVS (2008-06-09T14:20Z-0700) which
> modifies stringToURLArray in util.js to use getShortcutOrURI between
> specific and default calls to getSearchURL; overall behavior should be
> unchanged if no addons with an overloaded getShortcutOrURI are
> installed and enabled. Perhaps getShortcutOrURI, if acceptable, should
> be added to or replace most of liberator.bookmarks.getSearchURL?
> Perhaps there's an extra feature of getSearchURL that I'm not seeing
> (so I haven't removed calls to getSearchURL) but getShortcutOrURI
> checks search aliases and bookmark shortcuts as long as it hasn't been
> overridden by a function that doesn't fall back on the default
> function (the del.icio.us addon overriding function does fall back on
> the default).
I had not yet time to test the patch, but it seems that you aren't handling the
postdata from getShortcutOrURI, because in:
var searchURL = liberator.bookmarks.getSearchURL(text, alias);
searchURL is [uri, postdata]
but maybe it still works with your way. Fully replacing bookmarks.getSearchURL
is not recommended, but maybe the part which is dealing with keywords/bookmarks
is ok.
However, I think, it would be much better to replace the parts of getSearchURL()
and keep stringToURLArray quite unmodified.
Comments welcome by other vimp devs, haven't looked at that code for a long time.
--
Martin
More information about the Vimperator
mailing list