Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the advantages/disadvantages of using the Add-on SDK to develop my Firefox extension?

I am developing (yet another) password manager add-on for Firefox. My add-on needs to:

  • Add two context menu items to each password field.
  • Open a dialog box or floating panel when the menu item is selected.
  • Access a specific method of a specific XPCOM component.
  • Fill the password field.
  • Include a preferences window.
  • Be compatible with Firefox 4.0.

Preferably, also:

  • Run on Firefox 3.5 and 3.6.
    • Some users don't update to the latest version.
    • Firefox 4.0 won't run on a PowerPC Mac.
  • Install without a restart on Firefox 4.0.
  • Allow for localization.

I have tried the Add-on SDK (formerly known as Jetpack), and it makes it very easy to start developing. However, I find that HTML cannot easily create "native looking" dialog boxes and that the SDK is rather heavyweight. (It takes many kilobytes to build a simple extension; that includes an XPCOM component!)

What are the advantages and disadvantages of using the Add-on SDK to develop my Firefox extension? Is it ready for "serious" extension development?

like image 364
PleaseStand Avatar asked Apr 18 '11 21:04

PleaseStand


People also ask

What is Firefox add-ons?

Addons.mozilla.org (AMO), is Mozilla's official site for discovering and installing add-ons for the Firefox browser. Add-ons help you modify and personalize your browsing experience by adding new features to Firefox, enhancing your interactions with Web content, and changing the way your browser looks.

What is the use of add-ons?

An add-on is either a hardware unit that can be added to a computer to increase its capabilities or a program utility that enhances a primary program. Less frequently, some manufacturers and software developers use the term add-in .

Can you add extensions to Firefox Android?

You can find and install extensions for Firefox for Android in the browser's Add-ons Manager. Currently, you cannot install extensions directly from addons.mozilla.org. You can find and install extensions for Firefox for Android from addons.mozilla.org or from the browser's Add-ons Manager.

How do I add addons to Firefox?

Click the menu button. , click Add-ons and Themes and select Recommendations. To install a recommended add-on, click the blue + Install Theme or + Add to Firefox button, depending on the type of add-on.


1 Answers

Advantages:

  1. Jetpack API exposes high level APIs for most of the things you mentioned:

    • Add two context menu items
    • floating panel
    • API for password manager
  2. Jetpack based add-ons are restart-less.

  3. Jetpack based add-ons are future proof in a sense that high level APIs will remain unchanged for the coming versions of FF.

  4. You may be able to use some community developed modules for APIs that are not exposed by SDK.

  5. If this is not the last extension you're planning to build there is a potential for code reuse, by building third party modules as ones mentioned in 4 (see docs for details)

  6. Support for mobile FF is coming in post 1.0 version of Addon-SDK which may mean that your extension can be made compatible with mobile version of FF with minimal to zero effort.

  7. Jetpack comes with build-in unit testing framework.

  8. Has a better security model, which will ease add-on review process.

  9. Jetpack support commonjs modules / packages that which means that some of the code can be borrowed from other projects like nodejs for example.

Disadvantages:

  1. Jetpack no longer supports FF<4.
  2. Does not yet have support for localization.
  3. Has no API for building preference panels, but can be developed as third party module and shared with rest of the community.
  4. Add-on will contain code with layers of abstractions, that will increase size of add-on (there is ongoing work that will reduce xpi size by excluding files that are not used by add-on).
like image 182
gozala Avatar answered Sep 19 '22 05:09

gozala