[Conkeror] [PATCH 2/2] search-engine: provide alternative urls for search engine webjumps
John J Foerch
jjfoerch at earthlink.net
Sat Feb 7 12:38:34 PST 2009
David Kettler <kettler at internode.on.net> writes:
> The alternative url is visited when the user provides no arguments to
> the webjump; thus the webjump can function both as a way to invoke a
> search and as a bookmark.
>
> The alternative may be specified to define_search_engine_webjump().
> If no alternative is supplied, conkeror will try to guess an
> appropriate url. The guess uses the text/html url for the search
> engine and trims off the path and any "search." prefix on the domain.
> This works for all the supplied search engines.
This looks good, though I would make one change..
> +search_engine.prototype.intuit_home_page = function() {
Change this to an ordinary function called search_engine_get_homepage
that takes a search engine as its argument.
> + url = url.replace("//search.", "//");
What is the purpose of this line?
> Maybe it would be better to attach the alternative to the webjump
> object and to have the alternative logic in getWebJump(). Then it
> need not be in the handlers specified in define_webjump() and
> define_search_engine_webjump().
That's a thought. Let's get these current changes in first.
Thanks, I was looking at writing this feature myself, and now I don't
have to. :)
--
John Foerch
More information about the Conkeror
mailing list