satyr (owner)

Revisions

gist: 203415 Download_button fork
public
Public Clone URL: git://gist.github.com/203415.git
Embed All Files: show embed
open-addon-directory.ubiq.js #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
CmdUtils.CreateCommand({
  name: 'open add-on directory',
  description: "Opens the add-on's install location.",
  author: {name: 'satyr', email: 'murky.satyr@gmail.com'},
  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());
  },
});