Skip to content

Instantly share code, notes, and snippets.

@satyr
Created October 6, 2009 21:06
Show Gist options
  • Select an option

  • Save satyr/203415 to your computer and use it in GitHub Desktop.

Select an option

Save satyr/203415 to your computer and use it in GitHub Desktop.
CmdUtils.CreateCommand({
name: 'open add-on directory',
description: "Opens the add-on's install location.",
author: {name: 'satyr', email: '[email protected]'},
license: 'MIT',
icon: "chrome://mozapps/skin/xpinstall/xpinstallItemGeneric.png",
argument: noun_type_addon,
execute: function oad_execute({object: {data}}){
let profd = (Cc['@mozilla.org/file/directory_service;1']
.getService(Ci.nsIProperties)
.get('ProfD', Ci.nsIFile));
profd.append('extensions');
profd.append(data.id);
Utils.openUrlInBrowser(Utils.IOService.newFileURI(profd).spec);
},
preview: function oad_preview(pb, {object: {html, data}}) {
pb.innerHTML = (
html
? html.bold() +'<br/>'+ data.id
: this.previewDefault());
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment