зеркало из https://github.com/mozilla/gecko-dev.git
25 строки
775 B
JavaScript
25 строки
775 B
JavaScript
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");
|
|
|
|
File.createFromNsIFile(testFile).then(function(file) {
|
|
sendAsyncMessage("file.opened", { file });
|
|
});
|
|
});
|
|
|
|
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
|
|
});
|
|
});
|