Changes to how Extensions are Installed in Firefox 4

Dave Townsend

6

The next beta of Firefox 4 will include a change to how Firefox installs and uses extensions. Previously the files from the extension’s XPI would be extracted into their own directory in the filesystem and read from there, now the default is to just keep the XPI and load files out of it directly.

For many extensions this causes no problems however if your extension’s code tries to access its files directly or if your extension includes binary code, search plugins, dictionaries or window icons then you may either need to make changes to your extension to support the new method of installation or request that Firefox continue to unpack your extension’s files using the <em:unpack> install.rdf directive.

You can read more about the change and ways  you can support it in your extension at the Firefox 4 for Developers MDC page.

6 responses

  1. Leandro Santiago wrote on ::

    An user’s question: Does firefox still need be restarted to activate an extension?

    1. Dave Townsend wrote on ::

      For most extensions yes, but we have added support for a new type of extension that doesn’t need restarts to install. Extension developers would have to make (sometimes significant) changes to their extensions to support this right now or they can switch to using the Jetpack SDK which makes restartless extensions automatically.

  2. Micha wrote on :

    Hello,

    I use Thunderbird and also Firefox from Mozilla to balance the domination of well known software companies around the world.
    I also liked very much the convience that one had the possibilty to use the same profile under the big well known os from redmond and also under any linux distribution you like to use. I made an extra partition to use the profiles in this way (not willing to pay for an dedicated server and to pay the extra power bill every month).
    But the other day I faced complications with the lightning add-on in thunderbird. Will this problem also arise with the new way add-ons are handled in the future? Nothing against redmond, I dislike the hassle to administer two profiles for me.

    Yours sincerely,
    Micha

    1. Dave Townsend wrote on ::

      Micha, you seem to be asking if some problem that you don’t explain will also happen with this new installation method. I can’t really answer that, perhaps you could open a newsgroup thread with your issue.

  3. antistress wrote on ::

    Firefox 4 for Developers MDC page link seems incorrect, maybe https://developer.mozilla.org/en/Extensions/Updating_extensions_for_Firefox_4 is the good one now

  4. Michael Senkbeil wrote on ::

    We are developer of an add-on containing a shared library and we did add the directive. We can see that the XPI-file is beeing unpacked as expected but firefox cannot use the add-on. It seems that firefox cannot load the shared library.

    If the install the add-on seperately and register it via HKLM Software\MozillaPlugins the add-on works fine in firefox 4!

    Both techniques work fine in firefox 3.x.

    Is there a bug in firefox 4?