summaryrefslogtreecommitdiffstats
path: root/dom/html/test/formSubmission_chrome.js
blob: 1de6b79ed5d7b29d460f4762fed173869b4d8c71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* eslint-env mozilla/chrome-script */

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