1. Overview
Many Mozilla/Firefox extensions work fully or partially with Conkeror. Some work unmodified out of the box, while others require a bit of tweaking.
Manage your extensions just like other Plugins: M-x extensions
1.1. Notes on Compatibility
Often a compatible extension will be flagged as incompatible because it does not list Conkeror as a supported browser. Therefore it is a good idea to disable extension compatability checking by setting the preference extensions.checkCompatability to false. You can do this via about:config, or by running the following command:
M-: user_pref("extensions.checkCompatibility", false);Even after disabling the extension compatibility check, some extensions still fail to install, stating that they are not compatible when in fact they are. To install such an extension, its install.rdf file must be modified to list Conkeror as a supported browser. The process is roughly as follows.
- Download and save the extension.
- Make a scratch directory and extract the xpi there. (It is a zip file.)
Edit the file named install.rdf. Search the file until you find <em:targetApplication> entries. After the last entry, add the following:
<em:targetApplication> <Description> <em:id>{a79fe89b-6662-4ff4-8e88-09950ad4dfde}</em:id> <em:minVersion>0.1</em:minVersion> <em:maxVersion>9.9</em:maxVersion> </Description> </em:targetApplication>Zip the contents of the scratch directory and name the file <extension name>-conkeror.xpi.
The extension might now load in Conkeror.
1.2. Notes on Update Security
Often an extension will not be configured for secure updates. Mozilla can be forced to install such extensions by setting the preference extensions.checkUpdateSecurity to false, either via about:config, or by running the following command:
M-: user_pref("extensions.checkUpdateSecurity", false);
1.3. Installing Extensions
Mozilla has a whitelist of domains which are allowed to install extensions. By default, this whitelist allows only local URLs. Conkeror does not yet have a user interface for adding to this whitelist. Therefore, to install an extension, you must first save the xpi file locally, and then browse to the xpi file in Conkeror. (You can press s (save) to save the xpi from a page which links to it.)
Another option is to disable the whitelist checking altogether. This does entail some security risk, so buyer beware.
session_pref("xpinstall.whitelist.required", false);You can also modify the whitelist in your rc by setting the pref xpinstall.whitelist.add.
The extension manager dialog can be opened using the command M-x extensions. Here you can manage your extensions and access the Preferences dialog for extensions which provide one.
2. Fully Working Extensions
2.1. MozRepl
The MozRepl extension embeds into Conkeror a JavaScript repl accessible via TCP connection to a port listening on localhost, usually 4242. In some cases, it may be more convenient than M-: and in particular, it includes an Emacs Lisp package that provides an inferior JavaScript shell interface to Conkeror using MozRepl (more information here).
2.1.1. Setup
After installing MozRepl, add one of the following blocks of code to your rc. The preference method will require an additional restart. The longer method allows you to easily customize the port.
user_pref('extensions.mozrepl.autoStart', true);// Mozrepl
//
if ('@hyperstruct.net/mozlab/mozrepl;1' in Cc) {
let mozrepl = Cc['@hyperstruct.net/mozlab/mozrepl;1']
.getService(Ci.nsIMozRepl);
if (! mozrepl.isActive())
mozrepl.start(4242);
}
2.1.2. Environment Setup
Here is how to set up mozrepl to start in the Conkeror application context. That is the main context that contains all of Conkeror's global objects.
First make a file called ~/.mozrepl.js, which contains the code that follows.
var conkeror = Cc["@conkeror.mozdev.org/application;1"]
.getService().wrappedJSObject;
this.enter(conkeror);Now put the following code into your .conkerorrc:
let (mozrepl_init = get_home_directory()) {
mozrepl_init.appendRelativePath(".mozrepl.js");
session_pref('extensions.mozrepl.initUrl', make_uri(mozrepl_init).spec);
}
2.1.3. Setting up Convenient Accessors
Instead of using repl.enter(conkeror), you could make a special context which provides convenient accessors like window, buffer, and document to access the most recently used of those elements in conkeror. In a context like this, you will be able to read all conkeror functions and variables, but in order to modify them, you must prefix variable names with conkeror..
function repl_context() {
let ctx = {};
ctx.__proto__ = conkeror;
ctx.conkeror = conkeror;
ctx.window = conkeror.get_recent_conkeror_window();
ctx.buffer = ctx.window.buffers.current;
ctx.document = ctx.buffer.document;
return ctx;
}
this.enter(repl_context());
2.2. Adblock Plus
The Adblock Plus extension works perfectly in Conkeror. You can access the Preferences dialog via the extension manager (M-x extensions). After installing, you must add filter subscriptions via the Preferences dialog.
2.3. Venkman
The Venkman JavaScript debugger extension works perfectly in Conkeror. Open Venkman by passing the -venkman argument to Conkeror's command-line.
While this method still works, it is no longer necessary. If Venkman is installed, it can be launched via M-x venkman
2.4. DOM Inspector
The DOM Inspector extension works pefectly in Conkeror. Open the DOM Inspector in a running Conkeror like so:
conkeror -batch -inspector
2.5. CookieCuller
The CookieCuller extension, although unmaintained, works in Conkeror. It provides a UI for cookie management which is not otherwise currently available.
Use one of the following to access the cookie manager:
var cookie_culler_chrome = "chrome://cookieculler/content/CookieCuller.xul";
interactive("cookie-culler-dialog", "Show the CookieCuller settings in a dialog box.",
function (I) {
var frame = I.buffer.top_frame;
frame.openDialog(cookie_culler_chrome,
"CookieCuller",
"centerscreen,chrome,dialog,modal,resizable");
});
interactive("cookie-culler", "Open the CookieCuller settings in a new buffer.",
"find-url-new-buffer",
$browser_object = cookie_culler_chrome);An alternative is to use sqlitebrowser as for Bookmarks.
Use M-x permission-manager to manage cookie sites.
3. Partially Working Extensions
3.1. Noscript
The NoScript extension provides selective execution of JavaScript and plug-in code based on a whitelist. NoScript partially works with Conkeror (handling of <embedded>-tags (flash uses this) do not work). The contributed noscript.js module enables much of NoScript's functionality in Conkeror. This script is now included in Conkeror. To activate it, put this in your rc:
require("extensions/noscript.js");
3.2. CustomizeGoogle
The CustomizeGoogle extension partially works in Conkeror. You can access the Preferences dialog via the extension manager (M-x extensions).
It has been reported that the "Stream search results page" and "Remove click tracking" features do not work with Conkeror. Others may also be broken, but as yet unnoticed.
4. Other Extensions
4.1. Firebug
Firebug is not compatible with Conkeror, but Firebug Lite is. See Tips for details.
4.2. Google Gears
The Google Gears extension provides a database, services for parallel execution of JavaScript, a content cache, desktop integration, and geoip services. Gears has not been tested with Conkeror. If you have used Gears with Conkeror, please report your experience here, at the mailing list, or on the IRC channel.
4.2.1. Gears on Linux
Download Gears for Linux here. The install.rdf file in the extension must be modified before it will work with Conkeror. See the Notes on Compatibility section for step-by-step instructions.
4.2.2. Gears on Windows
Download Gears for Windows here. Run the installer. You may need to have Firefox installed when you run the installer.
The install.rdf file in C:\Program Files\Google\Google Gears\Firefox may need to be modified before Gears will work with Conkeror. See the Notes on Compatibility section for step-by-step instructions.
- Create a file conkeror-gears.reg with the following and double click on it in Windows Explorer to load its contents into the Registry.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\conkeror.mozdev.org\conkeror\Extensions]
"{000a9d1c-beef-4f90-9363-039d445309b8}"="C:\\Program Files\\Google\\Google Gears\\Firefox\\"- Restart Conkeror. Google Gears should show up in the list when you do M-x extensions.
4.2.3. Gears on OS X
Nothing is yet known about using Gears with Conkeror on OS X; however a cursory look suggests that the process is similar to that of installing on Windows. An installer appears to be provided for OS X, so it is assumed that Gears must be installed for Firefox, the Firefox xpi located and modified to support Conkeror, then loaded into Conkeror. As with Gears on Windows, please report your success or failure here, at the mailing list, or on the IRC channel.
4.2.4. Gears on Other Platforms
Nothing is yet known about using Gears on platforms other than those mentioned. Please report your experience here, at the mailing list, or on the IRC channel.