fx-compat: Simplify Zotero.File.download()

`NetUtil.newChannel()` can take a string spec, so don't bother parsing
to an nsIURI first

Follow-up to 7adb8fd150
This commit is contained in:
Dan Stillman 2022-05-24 03:02:11 -04:00
parent 7adb8fd150
commit 1a1a5924da

View file

@ -459,9 +459,8 @@ Zotero.File = new function(){
}
var deferred = Zotero.Promise.defer();
const uri_ = NetUtil.newURI(uri);
const inputChannel = NetUtil.newChannel({
uri: uri_,
uri,
loadUsingSystemPrincipal: true
});
const outputChannel = FileUtils.openSafeFileOutputStream(new FileUtils.File(path));