Firefox uses Downloads.jsm
these days. Note that this is a Promise
based async API for the most part, so you really want to consider using Task.jsm
.
Example:
Components.utils.import("resource://gre/modules/Downloads.jsm");
Components.utils.import("resource://gre/modules/Task.jsm");
Task.spawn(function logDownloads() {
try {
let list = yield Downloads.getList(Downloads.ALL);
let downloads = yield list.getAll();
for (let d of downloads) {
console.log(d.source.url + " -> " + d.target.path);
}
}
catch (ex) {
console.error(ex);
}
});