Skip to content

Commit e0f9207

Browse files
committed
1 parent a607d36 commit e0f9207

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

common/content/io.js

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -367,18 +367,10 @@ const IO = Module("io", {
367367
},
368368
};
369369
let {Downloads} = Cu.import("resource://gre/modules/Downloads.jsm", {});
370-
//let listName = (window.QueryInterface(Ci.nsIInterfaceRequestor)
371-
// .getInterface(Ci.nsIWebNavigation)
372-
// .QueryInterface(Ci.nsILoadContext)
373-
// .usePrivateBrowsing)
374-
// ? "getPrivateDownloadList"
375-
// : "getPublicDownloadList";
376-
for (let listName of ["getPrivateDownloadList", "getPublicDownloadList"]) {
377-
Downloads[listName]()
378-
.then(function (downloadList) {
379-
downloadList.addView(downloadListener);
380-
});
381-
}
370+
Downloads.getList(Downloads.ALL)
371+
.then(function (downloadList) {
372+
downloadList.addView(downloadListener);
373+
});
382374
}
383375
},
384376

@@ -388,12 +380,10 @@ const IO = Module("io", {
388380
} else {
389381
let {Downloads} = Cu.import("resource://gre/modules/Downloads.jsm", {});
390382
let downloadListener = this.downloadListener;
391-
for (let listName of ["getPrivateDownloadList", "getPublicDownloadList"]) {
392-
Downloads[listName]()
393-
.then(function (downloadList) {
394-
downloadList.removeView(downloadListener);
395-
});
396-
}
383+
Downloads.getList(Downloads.ALL)
384+
.then(function (downloadList) {
385+
downloadList.removeView(downloadListener);
386+
});
397387
}
398388
for (let [, plugin] in Iterator(plugins.contexts))
399389
if (plugin.onUnload)

0 commit comments

Comments
 (0)