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"));

opensearch_load_paths.unshift(make_file("/path/to/search-engines"));
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-engines1 will be sought first in your profile directory, 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.2 (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.

  1. You might find that the Mozilla engine (which Conkeror is built on) has created a subdirectory called searchplugins in your profile directory instead, in which case you can create a symbolic link to it and name the link search-engines. (1)

  2. This method is what may result in the creation of a searchplugins subdirectory as mentioned above (2)

Conkeror.org: OpenSearch (last edited 2016-05-25 11:11:56 by PhilHudson)