canmove, Confirmed users
1,448
edits
 (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>  | ||