Skip to content

Instantly share code, notes, and snippets.

@wbamberg
Created May 25, 2012 21:57
Show Gist options
  • Save wbamberg/2790823 to your computer and use it in GitHub Desktop.
Save wbamberg/2790823 to your computer and use it in GitHub Desktop.

Mozilla provides three different toolsets for developing add-ons. Choose the one that's right for you.

XUL-based add-ons

The traditional way of creating add-ons for Gecko-based applications is to modify the XUL used to define the application user interface and access platform features by loading XPCOM components.

Advantages of the traditional approach

  • make radical changes to the application UI
  • access powerful platform features
  • target other XUL-based applications such as Thunderbird

Disadvantages

  • Firefox for Android doesn't use XUL, so writing mobile add-ons requires a different approach
  • it can be complex to learn if you're not familiar with it
  • there's no help with packaging or writing unit tests for your add-on
  • the APIs you rely on can change as new versions of the platform are released

Learn more about traditional add-on development:

Add-on SDK

The Add-on SDK enables you to write Firefox add-ons using standard Web technologies: JavaScript, HTML, and CSS. It gives you stable JavaScript APIs which you can use to create add-ons, and a command-line tool to help you develop, test and package add-ons.

If you're new to add-on development, it's probably easier to get started with the Add-on SDK, although the officially supported APIs are more restrictive than the traditional approach.

Advantages of the SDK

  • high-level APIs and tool support simplify add-on development
  • compatibility guarantees across Firefox releases for the high-level APIs
  • easier to write secure add-ons
  • restartless by default: you can install SDK add-ons without restarting your browser

Disadvantages

  • the supported APIs are much more restrictive than those available to traditional add-ons. You can access more powerful APIs through the SDK, but lose the benefits of simplicity, compatibility, and security if you do so.

Learn more about the Add-on SDK

See the Add-on SDK documentation.

Add-on Builder

The Add-on Builder is based on the Add-on SDK, and the JavaScript APIs it provides are the same. However, instead of a command-line tool it provides a web-based development environment, including an editor and tools to run and package your add-on.

It's easier to get started using the Builder than with the SDK, but for more complex add-ons the SDK provides more powerful tool support.

Advantages of the Builder

  • no need to download anything: all you need is a browser and an Internet connection
  • complete environment for add-on development
  • no need to use the command line: just edit the source files and click "Run"

Disadvantages

  • you don't get to use your favorite source code editor
  • the tools that ship with the Builder aren't as powerful as the SDK tools

Learn more about the Add-on Builder

Visit the Add-on Builder and get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment