Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

This document describes how to package themes for Firefox and Thunderbird.

Pre-requisites

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.

Theme File Layout

Firefox/Thunderbird themes are packaged in an XPI file with the following structure:

theme.xpi:
  install.rdf
  preview.png
  icon.png
  chrome/
        browser/files
        communicator/files
        global/files
        mozapps/files
  ...
     
  • You must have a top-level chrome.manifest file which registers the chrome for the theme (as before) and also an install.rdf manifest that specifies metadata that is displayed in the Appearance section of the Add-ons Manager.
  • preview.png is a preview image which will show when double-clicked on a theme in the Appearance section of the Add-ons Manager. It can be any size.
  • icon.png is a 32x32 (max. 48x48) PNG (may contain alpha transparency) which will show up in the Appearance section of the Add-ons Manager.

install.rdf

Your install.rdf manifest will look something like this:

<?xml version="1.0"?>

<RDF xmlns="https://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:em="https://www.mozilla.org/2004/em-rdf#">

  <Description about="urn:mozilla:install-manifest">
    <em:type>4</em:type>
    more properties
  </Description>      
</RDF>

Required install.rdf Properties

Your install.rdf file must have the following properties. See the install.rdf Reference for more information:

  • em:id
  • em:version
  • em:type
  • em:targetApplication
  • em:name
  • em:internalName

Optional install.rdf Properties

  • em:description
  • em:creator
  • em:contributor
  • em:homepageURL
  • em:updateURL

Note that if your theme will be made available on the https://addons.mozilla.org website, it may not include an updateURL.

Sample install.rdf File

<?xml version="1.0"?>

<RDF xmlns="https://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:em="https://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>
    <em:type>4</em:type>

    <!-- 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>https://www.bengoodger.com/</em:homepageURL>

    <!-- Front End Integration Hooks (used by Theme Manager)-->
    <em:internalName>newtheme1</em:internalName>
  </Description>
</RDF>

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}
SeaMonkey    {92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}
Pale Moon    {8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4}

Official References for Toolkit API

Official References. Do not add to this list without contacting Benjamin Smedberg. Note that this page is included from the pages listed below. So: Don't Add Breadcrumbs!

Document Tags and Contributors

 Last updated by: rctgamer3,