2016-01-21 20:57:30 +03:00
|
|
|
Components.utils.importGlobalProperties(['File']);
|
|
|
|
|
|
|
|
addMessageListener("create-file-objects", function(message) {
|
|
|
|
let files = []
|
2017-02-08 12:18:32 +03:00
|
|
|
let promises = [];
|
2016-01-21 20:57:30 +03:00
|
|
|
for (fileName of message.fileNames) {
|
2017-02-08 12:18:32 +03:00
|
|
|
promises.push(File.createFromFileName(fileName).then(function(file) {
|
|
|
|
files.push(file);
|
|
|
|
}));
|
2016-01-21 20:57:30 +03:00
|
|
|
}
|
|
|
|
|
2017-02-08 12:18:32 +03:00
|
|
|
Promise.all(promises).then(function() {
|
|
|
|
sendAsyncMessage("created-file-objects", files);
|
|
|
|
});
|
2016-01-21 20:57:30 +03:00
|
|
|
});
|