Contents
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.
'j' is reddit-next-link: Move the 'cursor' to the next reddit entry.
'k' is reddit-prev-link: Move the 'cursor' to the previous reddit entry.
'h' is reddit-open-comments: Open the comments-page associated with the currently selected link.
',' is reddit-vote-up: Vote the currently selected link up.
'.' is reddit-vote-down: Vote the currently selected link down.
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
- reddit_end_behavior
Controls what action is taken by the commands reddit-next-link and reddit-prev-link at the last or first link, respectively. The value is given as a string. Supported values are stop, wrap, and page. The default is stop, which results in a null-op. wrap causes the highlight bar to wrap to the other end of the list. page will make the commands go to the next (or previous) page of links.
2.2. Gmail Mode
Gmail mode mostly exists to stop the conkeror keybindings clashing with Gmail's. It moves the following keybindings:
find-url, previously on 'g', is now on 'C-c g'.
copy, previously on 'c', is now on 'C-c c'.
shell-command-on-file, previously on 'x', is now on 'C-c x'.
save, previously on 's', is now on 'C-c s'.
reload, previously on 'r', is now on 'C-c r'.
follow, previously on 'f', is now on 'C-c f'.
follow-top, previously on 't', is now on 'C-c t'.
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:
follow-top, previously on 't', is now on 'C-c t'
shell-command-on-file, previously on 'x', is now on 'C-c x'
save, previously on 's', is now on 'C-c s'
go-up, previously on 'u', is now on 'C-c u'
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:
'+' is google-maps-zoom-in: Zoom in on the map.
'-' is google-maps-zoom-out: Zoom out of the map.
'C-b' is google-maps-pan-left: Pan the map left.
'C-f' is google-maps-pan-right: Pan the map right.
'C-p' is google-maps-pan-up: Pan the map up.
'C-n' is google-maps-pan-down: Pan the map down.
2.6. Google Reader Mode
Google reader is another mode for moving conflicting conkeror keybindings. It moves the following commands:
find-url, previously on 'g', is now on 'C-c g'.
save, previously on 's', is now on 'C-c s'.
follow-top, previously on 't', is now on 'C-c t'.
reload, previously on 'r', is now on 'C-c r'.
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:
- The user tries to access an article on "hahahoho".
- There is no such article, but the didyoumean tip asks "Did you mean: hahaha", so Conkeror tries to access "hahaha".
- There is no such article, and no didyoumean tip. The first match in the search results is "Haha".
- 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