welcome: please sign in
location: OpenSearch

The opensearch module provides define_opensearch_webjump, which is a function for defining a webjump from an opensearch description file. An opensearch description is a type of xml file which describes a search engine. It can be used in one of two ways.

define_opensearch_webjump("foo", make_file("/path/to/foo.xml"));

define_opensearch_webjump("foo", "foo.xml");

1. opensearch_load_paths

This is an array of paths in which to search for opensearch description files. Every element should be an nsIFile. By default, a subdirectory called 'search-engines' will be sought first in your profile, then in Conkeror's modules directory. There happens to be a 'search-engines' subdirectory in Conkeror's modules directory, and it contains a few opensearch files.

2. define_opensearch_webjump

This is the function that defines a webjump, given an opensearch description file. It takes two arguments: webjump name and file name (or path). If an absolute path is given for the second argument (an nsIFile, naturally) that's that. If a string filename is given instead, opensearch_load_paths will be searched for that file.

3. Getting OpenSearch Descriptions

OpenSearch description files can be found in any number of places, but one large repository on Mozdev bears mention in particular. That is the Mycroft Project.

Note that Conkeror does not yet support installing search plugins by the method employed at that site. (We're looking into it though.) For the time being, however, you can get around this problem by substituting the id and name of the engine into the url: http://mycroft.mozdev.org/installos.php.html/ID/NAME.xml. These data can be found in the title and onclick attributes of links. If this all sounds over complex to you, don't worry, we'll have a better install method eventually.

It is also worth noting that a lot of opensearch description files out there don't include the definition for providing search suggestions. Look for <Url type="application/x-suggestions+json" or <Url type="application/opensearchdescription+xml" in your files, and if they don't have it, a simple webjump will work just as well.

Conkeror.org: OpenSearch (last edited 2010-11-14 17:41:53 by retroj)