Prism has support for extensions. Extensions are built using the same methods as any Mozilla-based extension. Since Prism is a totally separate host application, there are some Prism-specific issues that you need to handle when creating your extension. Most notably, the Prism application ID and the differences in the user interface (UI). Extensions typically overlay the host application's UI to add toolbar buttons, menus and other features. One of Prism's features is an extreme lack of UI elements, which means that trying to use the same overlays in Firefox and Prism is really not possible.
The Basics
In order to install an extension in Prism, you need to follow the guidelines for building a Mozilla-based extension. To support Prism specifically, you'll need to add Prism to the list of target applications in the extension's install.rdf
file. The code snippet will look something like this:
<em:targetApplication> <!– Prism –> <Description> <em:id>prism@developer.mozilla.org</em:id> <em:minVersion>0.8</em:minVersion> <em:maxVersion>1.0.0.*</em:maxVersion> </Description> </em:targetApplication>
In addition to the install manifest changes, you may want to expose your extension into the Prism UI. Prism does have a few UI elements, such as a toolbox, toolbar, menubar, popup menus, statusbar and a container for the browser. You can use these UI elements to merge in your extension UI.
See the Prism main window XUL file for the actual structure: webrunner.xul
Porting an Existing Extension
Since there aren't many extensions designed explicitly for Prism, you may need to port your favorite extensions. This usually means extracting and editing the install.rdf
file to add Prism as a target application. You may also need to modify the extension's overlay to be able to work with the Prism UI. Many archive tools, like 7zip, can edit and update a file in the archive without needing to manually extract it and add it back into the XPI.
Installing
Prism supports a basic Add-on user interface which allows a user to manage extensions. Using this dialog, a user just launches a webapp and opens the Add-ons dialog. Then install the extension by either dragging and dropping the extension onto the dialog, or by clicking the “Install…” button, navigating to the extension and selecting it for installation. Extensions can be removed using the same dialog.