1. Overview

Page modes, in the spirit of Emacs major modes and GreaseMonkey scripts, allow site-specific functionality to be implemented in Conkeror.

2. Modes

2.1. Reddit Mode

The reddit mode provides a 'cursor', represented by highlighting a specific reddit entry in green, which can be moved up and down to interact with reddit items.

To open the current link, you can use return (open in current buffer) or o (open in new buffer). The copy command (bound to c by default) copies the URL of the linked article.

The reddit mode uses reddit_keymap.

2.1.1. Variables

2.2. Gmail Mode

Gmail mode mostly exists to stop the conkeror keybindings clashing with Gmail's. It moves the following keybindings:

If you don't like this, you could try enabling the Keyboard Shortcuts feature provided by Gmail Labs (Settings -> Labs) to move the Gmail keybindings to something that doesn't conflict, and changing your conkeror keybindings back. E.g. the following code restores 'g' to find-url:

define_key(gmail_keymap, "G", null, $fallthrough);
define_key(gmail_keymap, "g", "find-url");

The Gmail mode also provides C-c C-g, gmail-label-goto to jump to a specific label.

2.3. Google Search Results Mode

This mode sets the default browser-objects of the follow commands to operate on the main search results links.

Optionally, this mode can bind the keys 1 through 9 to follow corresponding links to pages of search results. To bind those keys, put the following in your rc:

google_search_bind_number_shortcuts();

2.4. Google Calendar Mode

This exists for similar reasons to Gmail mode. It moves the following commands:

To restore any of these commands, see the Gmail section, but use google_calendar_keymap instead of gmail_keymap.

2.5. Google Maps Mode

Google maps adds a few keyboard shortcuts for manipulating the map:

2.6. Google Reader Mode

Google reader is another mode for moving conflicting conkeror keybindings. It moves the following commands:

2.7. YouTube, Google Video, DailyMotion Modes

These modes facilitate downloading and running external programs on the embedded videos from these websites. Conkeror has a built-in "media" browser object class that is selected by the "e" prefix key. This browser object class uses a "media scraper", which by default just looks for URLs matching certain patterns in the webpage HTML source code, in order to prepare a list of embedded media files from which the user can choose using the completion mechanism. These page modes override the default media scraper with a more sophisticated one that works correctly on those sites. Furthermore, they set the media browser object class to be the default browser object class for the save, shell-command, and shell-command-url commands. As a result, for example, the save command invoked without a prefix while one of these page modes is enabled will automatically choose the embedded flash video file as the target to download.

2.8. XKCD Mode

The XKCD mode has local settings to make follow-next and follow-previous work for browsing the comics. Additionally, it can put the TITLE attribute of the comic in the page below the image. To enable that feature, put the following in your rc:

xkcd_add_title = true;

2.9. Wikipedia

Some of the information in this section may be outdated.

Quick walk-through: require("page-modes/wikipedia.js");

2.9.1. The didyoumean? module

For people not that great with spelling, there's the wikipedia-didyoumean.js module. The module works by checking whether the user is at the "article not found" page on any Wikipedia and looks for the "did you mean" box. If the "did you mean" tip is available, it immediately follows the tip. This works infinitely, so it will keep following the tip until it gets to an article that exists or until no more tips are available. If there are no tips available, but the search matched the text in any article on Wikipedia, it immediately goes to that article.

Example:

  1. The user tries to access an article on "hahahoho".
  2. There is no such article, but the didyoumean tip asks "Did you mean: hahaha", so Conkeror tries to access "hahaha".
  3. There is no such article, and no didyoumean tip. The first match in the search results is "Haha".
  4. Conkeror goes to "Haha".

To use this functionality, add this to your rc file:

require("wikipedia-didyoumean.js");

This works quite well in conjunction with the Wikipedia webjumps. Writing e.g. "en bruse sprengstien" jumps all the way to the English Wikipedia article on Bruce Springsteen.

2.10. StackOverflow Mode

This mode should work on any StackExchange site but is loaded by default for stackoverflow, serverfault, superuser and meta.stackoverflow. It provides a way to vote on questions, bound by default to V

PageModes (last edited 2010-01-29 01:28:54 by DaveKerschner)