Webjumps are created by the define_webjump function. The general form is as follows:
name - String that you type into the find-url prompt in order to follow this webjump.
spec - A string or a function.
string - For most webjumps, a string spec is sufficient. Give the url as a string, with the format code %s in the place where the webjump argument (typically a search term) can be subtituted in. When your webjump is called with no argument, an alternative webjump will be auto-generated by trimming the path off of the url. For example:
If you called the above webjump with no search term, Conkeror will go to http://www.example.com/. The alternative may instead be given explicitly using the $alternative keyword to define_webjump.
function - The spec may also be a function that takes the webjump argument as its parameter and returns the url to go to. By default, function webjumps require an argument, but that behavior can be controlled by supplying the $argument keyword to define_webjump. The value of $argument can be one of:
true - The webjump requires an argument.
false - The webjump does not require an argument, and minibuffer completion will not add a space.
"optional" - The web jump does not require an argument, but minibuffer completion will still add a space.
The default value of $argument for each type of webjump spec is as follows.
string - If the string contains the substitution pattern %s, $argument is set to "optional", and an alternative no-arg webjump is auto-generated by trimming the path from the url. If the string does not contain %s, $argument is set to false.
function - $argument defaults to true, meaning function webjumps require an argument unless specified otherwise in the call to define_webjump.
If the $alternative keyword is given, then the $argument defaults to "optional".
Webjumps that emulate filling in an html form can also be defined by providing the parameters in a $post_data array. For example, a language translation webjump could be defined as follows:
define_webjump("e2j", "http://www.freedict.com/onldict/onldict.php", $post_data = [['search', '%s'], ['exact', 'true'], ['selected', '10'], ['from', 'English'], ['to', 'Japanese'], ['fname', 'eng2jap1'], ['back', 'jap.html']], $alternative = "http://www.freedict.com/onldict/jap.html");
Webjumps that construct an index from links in a web page and then provide access to those links with completion can be defined using index webjumps.
All webjumps are in Conkeror's memory in a simple object called webjumps. This object can be manipulated for such things as deleting webjumps or creating aliases.
Making a Webjump Alias
webjumps.g = webjumps.google;