Updating extensions for Firefox 3

  • Revision slug: Updating_extensions_for_Firefox_3
  • Revision title: Updating extensions for Firefox 3
  • Revision id: 114658
  • Created:
  • Creator: Nickolay
  • Is current revision? No
  • Comment /* Other changes */

Revision Content

{{template.Fx_minversion_header(3)}}{{template.Draft()}} This article provides information that will be useful to developers that wish to update their extensions to work properly under Firefox 3.

{{template.Note("This article is extremely preliminary and is essentially just a stub. More detailed information is forthcoming as we get farther along in the Firefox 3 development cycle.")}}

Step 1: Update the install manifest

The first step -- and, for most extensions, the only one that will be needed -- is to update the install manifest file, <tt>install.rdf</tt>, to indicate compatibility with Firefox 3.

Simply find the line indicating the maximum compatible version of Firefox (which, for Firefox 2, might look like this):

 <em:maxVersion>2.0.0.*</em:maxVersion>

Change it to indicate compatibility with Firefox 3:

 <em:maxVersion>3.0.0.*</em:maxVersion>

Then reinstall your extension.

Note that at this point more changes in Firefox 3 are expected. These changes may break some extensions, so you shouldn't release an extension with 3.0.0.* maxVersion to the users until the Firefox 3 release candidate is out.

There have been (and will continue to be) a number of API changes that will likely break some extensions. We're still working on compiling a complete list of these changes.

Add localizations to the install manifest

Firefox 3 supports new properties in the install manifest to specify localized descriptions. The old methods still work however the new allow Firefox to pick up the localizations even when the add-on is disabled and pending install. See Localizing extension descriptions for more details.

Step 2: Ensure you are providing secure updates

If you are hosting addons yourself and not on a secure add-on hosting provider like addons.mozilla.org then you must provide a secure method of updating your add-on. This will either involve hosting your updates on an ssl website, or using cryptographic keys to sign the update information. Read Securing Updates for more information.

Step 3: Deal with changed APIs

Several APIs have been changed in significant ways. The most significant of these, which will likely affect a large number of extensions, are:

Bookmarks & History

If your extension accesses bookmark or history data in any way, it will need substantial work to be compatible with Firefox 3. The old APIs for accessing this information have been replaced by the new Places architecture. There are some basic documents about these APIs available, and more extensive content, including articles specifically covering how to update your extension, will be coming soon.

Password Manager

If your extension accesses user login information using the Password Manager, it will need to be updated to use the new Login Manager API.

  • The article Using nsILoginManager includes examples, including a demonstration of how to write your extension to work with both the Password Manager and the Login Manager, so it will work with both Firefox 3 and earlier versions.
  • nsILoginInfo
  • nsILoginManager

Other changes

Add simple changes you had to make while updating your extension to work with Firefox 3 here.

{{ wiki.languages( { "fr": "fr/Mise_\u00e0_jour_des_extensions_pour_Firefox_3", "ja": "ja/Updating_extensions_for_Firefox_3" } ) }}

Revision Source

<p>{{template.Fx_minversion_header(3)}}{{template.Draft()}}
This article provides information that will be useful to developers that wish to update their extensions to work properly under Firefox 3.
</p><p>{{template.Note("This article is extremely preliminary and is essentially just a stub.  More detailed information is forthcoming as we get farther along in the Firefox 3 development cycle.")}}
</p>
<h2 name="Step_1:_Update_the_install_manifest">Step 1: Update the install manifest</h2>
<p>The first step -- and, for most extensions, the only one that will be needed -- is to update the <a href="en/Install_Manifests">install manifest</a> file, <tt>install.rdf</tt>, to indicate compatibility with Firefox 3.
</p><p>Simply find the line indicating the maximum compatible version of Firefox (which, for Firefox 2, might look like this):
</p>
<pre class="eval"> <span class="plain">&lt;em:maxVersion&gt;2.0.0.*&lt;/em:maxVersion&gt;</span>
</pre>
<p>Change it to indicate compatibility with Firefox 3:
</p>
<pre class="eval"> <span class="plain">&lt;em:maxVersion&gt;3.0.0.*&lt;/em:maxVersion&gt;</span>
</pre>
<p>Then reinstall your extension.
</p>
<div class="note">Note that at this point more changes in Firefox 3 are expected. These changes may break some extensions, so you shouldn't release an extension with <code>3.0.0.*</code> maxVersion to the users until the Firefox 3 release candidate is out.</div>
<p>There have been (and will continue to be) a number of API changes that will likely break some extensions.  We're still working on compiling a complete list of these changes.
</p>
<h3 name="Add_localizations_to_the_install_manifest">Add localizations to the install manifest</h3>
<p>Firefox 3 supports new properties in the install manifest to specify localized descriptions. The old methods still work however the new allow Firefox to pick up the localizations even when the add-on is disabled and pending install. See <a href="en/Localizing_extension_descriptions">Localizing extension descriptions</a> for more details.
</p>
<h2 name="Step_2:_Ensure_you_are_providing_secure_updates">Step 2: Ensure you are providing secure updates</h2>
<p>If you are hosting addons yourself and not on a secure add-on hosting provider like <a class="external" href="https://addons.mozilla.org">addons.mozilla.org</a> then you must provide a secure method of updating your add-on. This will either involve hosting your updates on an ssl website, or using cryptographic keys to sign the update information. Read <a href="en/Extension_Versioning%2c_Update_and_Compatibility#Securing_Updates">Securing Updates</a> for more information.
</p>
<h2 name="Step_3:_Deal_with_changed_APIs">Step 3: Deal with changed APIs</h2>
<p>Several APIs have been changed in significant ways.  The most significant of these, which will likely affect a large number of extensions, are:
</p>
<h3 name="Bookmarks_&amp;_History">Bookmarks &amp; History</h3>
<p>If your extension accesses bookmark or history data in any way, it will need substantial work to be compatible with Firefox 3.  The old APIs for accessing this information have been replaced by the new <a href="en/Places">Places</a> architecture.  There are some basic documents about these APIs available, and more extensive content, including articles specifically covering how to update your extension, will be coming soon.
</p>
<h3 name="Password_Manager">Password Manager</h3>
<p>If your extension accesses user login information using the Password Manager, it will need to be updated to use the new Login Manager API.
</p>
<ul><li> The article <a href="en/Using_nsILoginManager">Using nsILoginManager</a> includes examples, including a demonstration of how to write your extension to work with both the Password Manager and the Login Manager, so it will work with both Firefox 3 and earlier versions.
</li><li> <code><a href="en/NsILoginInfo">nsILoginInfo</a></code>
</li><li> <code><a href="en/NsILoginManager">nsILoginManager</a></code>
</li></ul>
<h3 name="Other_changes">Other changes</h3>
<p><i>Add simple changes you had to make while updating your extension to work with Firefox 3 here.</i>
</p>
<ul><li> {{template.Interface("nsIAboutModule")}} implementations are now required to support the <code>getURIFlags</code> method. See {{template.Source("netwerk/protocol/about/public/nsIAboutModule.idl", "nsIAboutModule.idl")}} for documentation. This affects extensions that provide new <tt>about:</tt> URIs. ({{template.Bug(337746)}})
</li><li> Changes to <a href="en/NsISupports_proxies">nsISupports proxies</a> <a class="external" href="http://groups.google.com/group/mozilla.dev.platform/browse_thread/thread/78236a4b312a2de4/939240fc3f5123a8?lnk=st&amp;rnum=1#939240fc3f5123a8"> and possibly to threading-related interfaces need to be documented.
</a></li></ul><a class="external" href="http://groups.google.com/group/mozilla.dev.platform/browse_thread/thread/78236a4b312a2de4/939240fc3f5123a8?lnk=st&amp;rnum=1#939240fc3f5123a8">
<div class="noinclude">
</div>
{{ wiki.languages( { "fr": "fr/Mise_\u00e0_jour_des_extensions_pour_Firefox_3", "ja": "ja/Updating_extensions_for_Firefox_3" } ) }}</a>
Revert to this revision