views:

33

answers:

2

Two related questions:

  1. Is there an API to produce a list of all the installed extensions in Firefox?

  2. If so, how would I uniquely identify an extension? What I need is to have an ID that persists through different versions of an extension and ideally through a renaming (so name may not be the best option). Is it GUID?

Thanks!

A: 

To get extensions list, Please take a look at nsExtensionManager.js in components folder, there is a variable called validExtensions which use to generate extensions.ini in firefox profile directory

For unique ID, I guess its depend on extensions itself, because some extensions like noscript, adblockplus use GUID, and some extensions like firebug,foxmarks using email address style.

S.Mark
+1  A: 

You can get the list of items from nsIExtensionManager. Yes there is a unique ID for extensions (nsIUpdateItem::id), as specified in the install manifest.

On a second thought, this is where FUEL is really useful. Try this in the Error Console:

Application.extensions.all.forEach(function(item) { alert(item.id) })
Nickolay