Ben Goodger, 05/17/2004
This document describes how to package themes for Firefox 0.9 and newer, and Thunderbird 0.8 and newer.
This document assumes you've already created a theme, or know a little bit about it at least. Making a theme for Firefox or Thunderbird requires knowledge of Cascading Stylesheets (CSS), probably XBL, and some graphic design and aesthetic skill (...or maybe not ;-) This document describes only how Themes are packaged in order to be shown in Firefox's Themes window.
New Firefox/Thunderbird themes are laid out like so:
theme.jar: install.rdf contents.rdf preview.png icon.png browser/* global/* mozapps/* communicator/* ...
You must have a toplevel contents.rdf
file that registers
the chrome for the theme (as before) and also an install.rdf
manifest that specifies metadata that is displayed in the Themes
window. preview.png
is a preview image which will show
in the scrolling preview area in the Themes window. It can be any size.
icon.png
is a 32x32 png (may contain alpha transparency)
which will show up in the Themes list in the Themes window.
Your install.rdf
manifest will look something like this:
<?xml version="1.0"?> <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <Description about="urn:mozilla:install-manifest"> <-- properties --> </Description> </RDF>
Your install.rdf file must have these properties:
<em:id>{daf44bf7-a45e-4450-979c-91cf07434c3d}</em:id>
<em:version>4.6</em:version>
<em:targetApplication> <Description> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minVersion>0.7</em:minVersion> <em:maxVersion>1.2</em:maxVersion> </Description> </em:targetApplication>
<em:name>Plastic Fantastic</em:name>
Your install.rdf file may have these properties in addition to the ones above:
<em:description>Advanced foo tools.</em:description>
<em:creator>John Doe</em:creator>
<em:contributor>Jane Doe</em:contributor>
<em:homepageURL>http://www.foo.com/</em:homepageURL>
text/rdf
or the update checker will not work. Firefox will substitute the
following values into this URL in case you wish to generate the
response RDF dynamically, such as using PHP or CGI:%ITEM_ID% | The GUID of the extension being updated |
%ITEM_VERSION% | The version of the extension being updated |
%APP_ID% | The GUID of the current application |
%APP_VERSION% | The version of the current application |
<em:updateURL>http://www.foo.com/update.cgi?id=%ITEM_ID%&version=%ITEM_VERSION%</em:updateURL>
chrome:name
property used
in your contents.rdf
file, e.g. for the default theme,
this string is "classic/1.0". It must match perfectly, including
case, otherwise your theme will not apply.
<?xml version="1.0"?> <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <Description about="urn:mozilla:install-manifest"> <em:id>{18b64b56-d42f-428d-a88c-baa413bc413f}</em:id> <em:version>1.0</em:version> <!-- Target Application this extension can install into, with minimum and maximum supported versions. --> <em:targetApplication> <Description> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minVersion>0.8</em:minVersion> <em:maxVersion>0.9</em:maxVersion> </Description> </em:targetApplication> <!-- Front End MetaData --> <em:name>New Theme 1</em:name> <em:description>A test theme for Firefox</em:description> <em:creator>Ben Goodger</em:creator> <em:contributor>John Doe</em:contributor> <em:homepageURL>http://www.bengoodger.com/</em:homepageURL> <!-- Front End Integration Hooks (used by Theme Manager)--> <em:internalName>newtheme1</em:internalName> </Description> </RDF>
All themes must use the Firefox Version Format to describe their versioning. The FVF looks like this:
major.minor.sub[+]
e.g. 1.2.1
and 0.8+
. "+" indicates that the
item is from the "development" period between releases.
Not all fields are necessary, e.g. 1.2 is as valid as 1.2.0
The following are some common target application GUIDs that you can
use in your targetApplication properties:
Firefox | {ec8030f7-c20a-464f-9b0e-13a3a9e97384} |
Thunderbird | {3550f703-e582-4d05-9a08-453d09bdfdc6} |
As described above, a theme can provide its own custom update URL
which takes the form of a RDF file. Presently this file must be served
as text/rdf. See em:updateURL
above for details of the URL
format. The RDF file must be formatted like so:
<RDF:Description about="urn:mozilla:extension:{THEME GUID}"> <em:version><Version Number Being Offered></em:version> <em:updateLink><XPI URL></em:updateLink> </RDF:Description>
e.g.
<RDF:Description about="urn:mozilla:extension:{THEME GUID}"> <em:version>5.0</em:version> <em:updateLink>http://www.foo.com/theme-5.0.jar</em:updateLink> </RDF:Description>