Created
February 9, 2010 23:55
-
-
Save gialloporpora/299839 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
/* This command open the profile folder */ | |
function openLocalFolder(dir){ | |
nsLocalFile = Components.Constructor("@mozilla.org/file/local;1","nsILocalFile", "initWithPath"); | |
new nsLocalFile(dir).reveal(); | |
} | |
CmdUtils.CreateCommand({ | |
names: ["open-profile"], | |
description: "Open the profile directory in your file explorer..", | |
help: "Type open-profile to open the profile folder.", | |
author: { | |
name: "Sandro Della Giustina", | |
email: "[email protected]", | |
homepage: "http://labs.mozilla.com/", | |
}, | |
license: "GPL", | |
homepage: "http://ubiquity.mozilla.com/", | |
icon: "http://www.mozilla.com/favicon.ico", | |
execute: function execute() { | |
// Get the profile directory. | |
propertiesService = Cc["@mozilla.org/file/directory_service;1"] | |
.getService(Ci.nsIProperties); | |
currProfD = propertiesService.get("ProfD", Ci.nsIFile); | |
profileDir = currProfD.path; | |
openLocalFolder(profileDir ); | |
}, | |
preview: function preview(pblock, args) { | |
pblock.innerHTML = "Open profile directory..."; | |
}, | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment