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