User
User

Reputation: 24749

How to compile a new version of a Firefox extension?

I have the source code with the changes I made, and I need to get an .xpi file. I understand we are not necessarily using a compiler, but somehow I need to build this .xpi file.

My users are downloading a single .xpi file and loading it into Firefox to use. So I need to update the version number, build a .xpi file and sign it, if needed.

I was not the original developer, but my changes involve basic Javascript changes.

Upvotes: 0

Views: 965

Answers (1)

Kaspar Lee
Kaspar Lee

Reputation: 5596

An .xpi file is basically a .zip file with the file extension name changed.

I just use a regular zipping program, 7-Zip or MS Windows (7, 8, 8.1) Context Menu "Send To... > Compressed (zipped) folder").

Then, make sure File Extensions are shown, and rename foo.zip to foo.xpi.

You can then give it to users to install.


To answer your comment:

Yes, you need to get it signed by AMO (addons.mozilla.org).

It is still possible to install unsigned add-ons up until Firefox 46, by changing a preference in about:config, but after 46 is released, it will not be possible.

You can sign it by first creating a Firefox Account (AMO just stated using Firefox Accounts instead of their own separate account) and logging in on AMO (hopefully you can work out how to do this!).

Then in the nav-bar, click Tools > Submit a New Add-on.... You will need to Upload your .xpi file (note that you can upload .zip and .jar files). Then upload an image, write a description, etc.

At some point (normally when you upload the file), it will ask if you want your add-on to be Listed, Hidden or Unlisted:

  • A Listed add-on lets people download it on AMO as well as your own site / own method of distribution. Anyone on AMO can see your add-on

  • A Hidden add-on is hosted by AMO, but not visible to anyone but the authors (in this case, you)

  • An Unlisted add-on is not hosted on AMO. You have to distribute the file yourself.

Actually, here is a quote of the text exactly as it is on AMO:

Addon Visibility

Listed: Visible to everyone on https://addons.mozilla.org and included in search results and listing pages

Hidden: Hosted on https://addons.mozilla.org, but hidden to anyone but authors. Used to temporarily hide listings or discontinue them.

Unlisted: Not distributed on https://addons.mozilla.org. Developers will upload new versions for signing and distribute the add-ons on their own. (beta)

Note that Unlisted is currently in Beta

Read this section on MDN for more information

Upvotes: 2

Related Questions