User:Jorge.villalobos/AddonPackaging/Manifest: Difference between revisions
(Manifest file, first draft) |
(Added chrome-domain as a required property.) |
||
| Line 18: | Line 18: | ||
Some properties are required, some are optional.<br> | Some properties are required, some are optional.<br> | ||
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.<br> | 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.<br> | ||
Property ordering is irrelevant. Any HTML content that doesn't correspond to properties in the spec will be ignored.<br> | Property ordering is irrelevant. Any HTML content that doesn't correspond to properties in the spec will be ignored.<br> | ||
== Required properties<br> == | == Required properties<br> == | ||
Your manifest must specify these properties correctly otherwise your addon may not install.<br> | Your manifest must specify these properties correctly otherwise your addon may not install.<br> | ||
=== id<br> === | === id<br> === | ||
The add-on id, which is a:<br> | The add-on id, which is a:<br> | ||
*A string formatted like so: ''extensionname@organization.tld''. (Recommended)<br> | *A string formatted like so: ''extensionname@organization.tld''. (Recommended)<br> | ||
*A [https://developer.mozilla.org/en/Generating_GUIDs GUID]. | *A [https://developer.mozilla.org/en/Generating_GUIDs GUID]. | ||
'''Example:'''<br> | '''Example:'''<br> | ||
<pre><p id="id">packaging-example@wiki.mozilla.org</p> | <pre><p id="id">packaging-example@wiki.mozilla.org</p> | ||
</pre> | </pre> | ||
=== name<br> === | === name<br> === | ||
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.<br> | 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.<br> | ||
'''Example:'''<br> | '''Example:'''<br> | ||
<pre><p id="name">Add-on Packaging Spec Example</p> | <pre><p id="name">Add-on Packaging Spec Example</p> | ||
</pre> | </pre> | ||
=== version === | === version === | ||
A version string identifying the version of the addon being supplied. It must conform to the rules of the [https://developer.mozilla.org/en/Toolkit_version_format Toolkit version format]. | A version string identifying the version of the addon being supplied. It must conform to the rules of the [https://developer.mozilla.org/en/Toolkit_version_format Toolkit version format]. | ||
'''Example:'''<br> | '''Example:'''<br> | ||
<pre><p id="version">1.0</p> | <pre><p id="version">1.0</p> | ||
</pre> | </pre> | ||
=== type<br> === | === type<br> === | ||
An integer value representing the type of add-on.<br> | An integer value representing the type of add-on.<br> | ||
*2 Extensions | *2 Extensions | ||
*4 Themes | *4 Themes | ||
*8 Locale | *8 Locale | ||
*32 [https://developer.mozilla.org/en/Multiple_Item_Packaging Multiple Item Package]<br> | *32 [https://developer.mozilla.org/en/Multiple_Item_Packaging Multiple Item Package]<br> | ||
'''Example:'''<br> | |||
<pre><p id="type">2</p> | |||
</pre> | |||
=== chrome-domain<br> === | |||
The chrome domain determines how chrome and resource URLs are resolved for the add-on.<br> | |||
'''Example:'''<br> | '''Example:'''<br> | ||
<pre><p id=" | <pre><p id="chrome-domain">packagingspec</p> | ||
</pre> | </pre> | ||
=== target-applications<br> === | For the above example, the add-on would be registering itself for URLs starting with ''chrome://packagingspec'' and ''resource://packagingspec''.<br> | ||
=== target-applications<br> === | |||
Specifies the applications targeted by this addon.<br> | Specifies the applications targeted by this addon.<br> | ||
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 [https://addons.mozilla.org/en-US/firefox/pages/appversions valid application versions]).<br> | 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 [https://addons.mozilla.org/en-US/firefox/pages/appversions valid application versions]).<br> | ||
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.<br> | 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.<br> | ||
The manifest must specify at least one target application.<br> | The manifest must specify at least one target application.<br> | ||
'''Example:'''<br> | '''Example:'''<br> | ||
<pre><ol id="target-applications"> | <pre><ol id="target-applications"> | ||
<!-- Firefox. --> | <!-- Firefox. --> | ||
| Line 86: | Line 95: | ||
<p class="max-version">2.1.*</p> | <p class="max-version">2.1.*</p> | ||
</li> | </li> | ||
</ol></pre> | </ol></pre> | ||
Since it's possible to have multiple target applications, the properties are specified using ''class'' instead of ''id''.<br> | Since it's possible to have multiple target applications, the properties are specified using ''class'' instead of ''id''.<br> | ||
=== Example minimal manifest<br> === | === Example minimal manifest<br> === | ||
This is an example manifest that includes all required properties:<br> | This is an example manifest that includes all required properties:<br> | ||
<pre><?xml version="1.0"?> | <pre><?xml version="1.0"?> | ||
<!DOCTYPE html> | <!DOCTYPE html> | ||
| Line 99: | Line 108: | ||
<p id="name">Add-on Packaging Spec Example</p> | <p id="name">Add-on Packaging Spec Example</p> | ||
<p id="version">1.0</p> | <p id="version">1.0</p> | ||
<p id="chrome-domain">packagingspec</p> | |||
<!-- Extension. --> | <!-- Extension. --> | ||
<p id="type">2</p> | <p id="type">2</p> | ||
| Line 113: | Line 123: | ||
</html> | </html> | ||
</pre> | </pre> | ||
== Optional properties<br> == | == Optional properties<br> == | ||
(work in progress)<br> | (work in progress)<br> | ||
Revision as of 22:06, 24 May 2010
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.
- 2 Extensions
- 4 Themes
- 8 Locale
- 32 Multiple Item Package
Example:
<p id="type">2</p>
chrome-domain
The chrome domain determines how chrome and resource URLs are resolved for the add-on.
Example:
<p id="chrome-domain">packagingspec</p>
For the above example, the add-on would be registering itself for URLs starting with chrome://packagingspec and resource://packagingspec.
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>
<p id="chrome-domain">packagingspec</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)