зеркало из https://github.com/mozilla/gecko-dev.git
16 строки
351 B
JavaScript
16 строки
351 B
JavaScript
Cu.importGlobalProperties(["File"]);
|
|
|
|
addMessageListener("files.open", function (message) {
|
|
let list = [];
|
|
let promises = [];
|
|
for (let path of message) {
|
|
promises.push(File.createFromFileName(path).then(file => {
|
|
list.push(file);
|
|
}));
|
|
}
|
|
|
|
Promise.all(promises).then(() => {
|
|
sendAsyncMessage("files.opened", list);
|
|
});
|
|
});
|