mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-04-03 13:02:57 +00:00
16 lines
409 B
JavaScript
16 lines
409 B
JavaScript
Components.utils.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);
|
|
});
|
|
});
|