Created
October 6, 2009 21:06
-
-
Save satyr/203415 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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