User:Jorge.villalobos/AddonPackaging/Manifest

From MozillaWiki
< User:Jorge.villalobos‎ | AddonPackaging
Revision as of 21:50, 24 May 2010 by Jorge.villalobos (talk | contribs) (Manifest file, first draft)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The Manifest File

The manifest file for the new packaging system is defined using a subset of HTML. The file name is manifest.html, and must reside in the root of the package file.

The existence of this file determines whether the new packaging system is applied or not. For backward compatibility, package files can contain both the new and old manifest files.

Layout

The basic layout of a manifest file is like so:

<?xml version="1.0"?>
<!DOCTYPE html>
<html>
  <body>
     <!-- properties -->
  </body>
</html>

Some properties are required, some are optional.

Single value properties are defined using the paragraph tag (<p>), and multi-valued properties are defined using the ordered list tags (<ol>, <li>). The id attribute determines the property each value corresponds to, for single-valued properties. The class attribute is used for properties that can be repeated in the same manifest, like target applications.

Property ordering is irrelevant. Any HTML content that doesn't correspond to properties in the spec will be ignored.

Required properties

Your manifest must specify these properties correctly otherwise your addon may not install.

id

The add-on id, which is a:

  • A string formatted like so: extensionname@organization.tld. (Recommended)
  • A GUID.

Example:

<p id="id">packaging-example@wiki.mozilla.org</p>

name

The name of the add-on; intended for display in the UI. It can be optionally localized as described below, but a default name should always be defined. The name cannot be empty.

Example:

<p id="name">Add-on Packaging Spec Example</p>

version

A version string identifying the version of the addon being supplied. It must conform to the rules of the Toolkit version format.

Example:

<p id="version">1.0</p>

type

An integer value representing the type of add-on.

Example:

<p id="type">2</p>

target-applications

Specifies the applications targeted by this addon.

The add-on will work with the application identified by the application-id property specified, from the minimum version min-version up to and including the maximum version max-version (for a comprehensive list of application IDs and valid min/max versions for them see valid application versions).

These version strings are formatted in the same fashion as the version property and will be compared to the application version; this allows the extension author to specify which versions of the application an add-on has been tested with.

The manifest must specify at least one target application.

Example:

<ol id="target-applications">
  <!-- Firefox. -->
  <li>
    <p class="application-id">{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</p>
    <p class="min-version">3.6</p>
    <p class="max-version">4.0.*</p>
  </li>
  <!-- SeaMonkey. -->
  <li>
    <p class="application-id">{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</p>
    <p class="min-version">2.1</p>
    <p class="max-version">2.1.*</p>
  </li>       
</ol>

Since it's possible to have multiple target applications, the properties are specified using class instead of id.

Example minimal manifest

This is an example manifest that includes all required properties:

<?xml version="1.0"?>
<!DOCTYPE html>
<html>
  <body>
     <p id="id">packaging-example@wiki.mozilla.org</p>
     <p id="name">Add-on Packaging Spec Example</p>
     <p id="version">1.0</p>
     <!-- Extension. -->
     <p id="type">2</p>
     
     <ol id="target-applications">
       <!-- Firefox. -->
       <li>
         <p class="application-id">{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</p>
         <p class="min-version">3.6</p>
         <p class="max-version">4.0.*</p>
       </li>      
     </ol>
  </body>
</html>

Optional properties

(work in progress)