mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-05 16:46:26 +00:00
26 lines
797 B
JavaScript
26 lines
797 B
JavaScript
var { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
|
Cu.importGlobalProperties(["File"]);
|
|
|
|
addMessageListener("file.open", function () {
|
|
var testFile = Cc["@mozilla.org/file/directory_service;1"]
|
|
.getService(Ci.nsIDirectoryService)
|
|
.QueryInterface(Ci.nsIProperties)
|
|
.get("ProfD", Ci.nsIFile);
|
|
testFile.append("prefs.js");
|
|
|
|
sendAsyncMessage("file.opened", {
|
|
file: new File(testFile)
|
|
});
|
|
});
|
|
|
|
addMessageListener("dir.open", function () {
|
|
var testFile = Cc["@mozilla.org/file/directory_service;1"]
|
|
.getService(Ci.nsIDirectoryService)
|
|
.QueryInterface(Ci.nsIProperties)
|
|
.get("ProfD", Ci.nsIFile);
|
|
|
|
sendAsyncMessage("dir.opened", {
|
|
dir: testFile.path
|
|
});
|
|
});
|