Skip to content

Instantly share code, notes, and snippets.

@cou929
Created January 5, 2011 13:58
Show Gist options
  • Save cou929/766346 to your computer and use it in GitHub Desktop.
Save cou929/766346 to your computer and use it in GitHub Desktop.
Sample code for extension manager
/*
* Kosei Moriyama <cou929@gmail.com>
*
* Sample code for Firefox Extension.
* Get installed extension data using extensionsManager.
* List of attributes of extension data (returned value of getItemList()):
* http://www.oxymoronical.com/experiments/apidocs/interface/nsIUpdateItem
*/
var extensionsManager = Components.classes["@mozilla.org/extensions/manager;1"]
.getService(Components.interfaces.nsIExtensionManager);
var itemsList = extensionsManager.getItemList(2, {});
for (var i=0; i<itemsList.length; i++) {
Application.console.log(itemsList[i].name); // show name of installed extension
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment