gecko-dev/dom/html/test/formSubmission_chrome.js

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);
});
});