welcome: please sign in
location: Diff for "Extensions"
Differences between revisions 118 and 119
Revision 118 as of 2016-02-05 03:41:24
Size: 7958
Editor: scottjad
Revision 119 as of 2016-02-05 03:41:47
Size: 7962
Editor: scottjad
Deletions are marked like this. Additions are marked like this.
Line 33: Line 33:
 * EPUBReader  * [[EPUBReader]]

1. Basics

1.1. Extension Manager

To open the extension manager, do: M-x extensions.

Note: there are some circumstances under which the extensions manager does not complete loading. This debian bug report describes some of the symptoms and some possible solutions http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=683343

If you encounter this problem, you may be able to install extensions directly, without going through the extension manager.

1.2. Installing Extensions

After completing the steps below, an extension can be installed in M-x extensions by clicking on the "Tools" button (represented by an icon and is generally at the top of the window and to the left of the search field) and selecting "Install Add-on from File..."

If you are unable to use the extension manager, you can open a URL pointing to the .xpi file for the extension, either a web url or a local file url (if you have already downloaded the .xpi).

There is a security system in Mozilla that prevents you from installing xpi files from unknown sites. Conkeror does not yet have a complete UI for managing trusted sites, so you may encounter silent failure when trying to install an extension. One option is to download the xpi file and install it from your own computer. Another option is to disable the security system like this:

session_pref("xpinstall.whitelist.required", false);      

2. Tried Extensions

Many Mozilla/Firefox extensions work fully or partially with Conkeror. Some work unmodified out of the box, while others require a bit of tweaking. Here is a collection of notes about the extensions we have tried.

3. Compatibility

While a few extensions work out of the box with Conkeror, most extensions are, properly speaking, Firefox extensions, meaning that they were written for Firefox and often have in greater or lesser degree, dependencies on features only found in Firefox. The Conkeror user looking to use such extensions should expect to be in for a little bit of work. Following are the typical steps to take with a new extension.

3.1. Normal Install

First try to install the extension. If it installs without complaint, that means it is already either explicitly marked as compatible with Conkeror, or compatible with toolkit, which is another word for XULRunner. Skip Forced Install and go straight on to Glue Code. But if normal install failed with an error about not being compatible, read on.

3.2. Forced Install

The most assured way to force an extension to install in Conkeror when it is not marked as compatible is to make one or two changes to files in the xpi archive of the extension. Save the xpi to disk, and make the following changes to it. The xpi file is a zip archive, so Emacs' archive-mode can be used to make these changes.

For those allergic to Emacs, you may use archivemount. Consult your system's package manager, if you can install it.

If none of those options are available to you, manually unzip the xpi file, make changes, then zip it back.

3.2.1. Edit install.rdf

All extensions contains a file in their root called install.rdf. This file is a kind of manifest of the name, author, version, and description of the extension, and most interestingly, what programs it is compatible with.

The file will contain one or more stanzas of em:targetApplication listing the compatible programs. em:id should be either toolkit@mozilla.org or {a79fe89b-6662-4ff4-8e88-09950ad4dfde}.

Min and maxVersion must match your xulrunner or Firefox. The resulting stanza should look something like this:

<!-- Conkeror -->

Some extensions don't use "em:" in their install.rdf so look at the other targetApplication elements and remove the "em:"'s from the above if need.

3.2.2. Delete META-INF Files

Some extensions contain a directory called META-INF. The files in it are simply a digital signature to prevent people from installing files that have been tampered with. (Imagine that.) If you modified any files in the extension, you will need to delete the META-INF files in order to force an install of the extension. Otherwise you will see a console warning like this: "WARN addons.xpi: Invalid XPI: Error: XPI is incorrectly signed".

3.3. Glue Code

Installing an extension is usually only half the work. The other half is writing glue to be able to use the extension in Conkeror. This typically involves writing one or more Conkeror commands to invoke the features provided by the extension. Extensions that have deep dependencies on behaviors unique to Firefox will be more of a challenge than simple ones, or ones designed for portability across applications. There is no way we can tell you everything you need to know to write glue code for extensions, but we can give you a few examples. How these examples apply in the case of each individual extension will vary widely, and fluency in javascript and knowledge of the Mozilla Extension platform will be your best tools for success.

TO-DO: links to info about how extensions work.

TO-DO: example code for common things like opening chrome windows.

3.4. Jetpack

Jetpack is a Mozilla sdk for building extensions more easily than by the traditional method, so we can make some general notes that will apply to any extension built with Jetpack.

3.4.1. Panel

Jetpack's 'panel' feature is Firefox-only.

4. Old Stuff

Note: no longer the preferred method.

To-do: find out if and when this information is still useful, and edit it to say such.

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

5. 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);      

Conkeror.org: Extensions (last edited 2016-02-05 03:41:47 by scottjad)