More saveURI fixes

This commit is contained in:
Simon Kornblith 2012-11-12 01:10:32 -05:00
parent b6fee9a357
commit 42215d0441
3 changed files with 22 additions and 4 deletions

View File

@ -1189,7 +1189,13 @@ function downloadPDFTool(tool, version, callback) {
wbp.progressListener = progressListener;
Zotero.debug("Saving " + uri.spec + " to " + fileURL.spec);
wbp.saveURI(uri, null, null, null, null, fileURL);
try {
wbp.saveURI(uri, null, null, null, null, fileURL);
} catch(e if e.name === "NS_ERROR_XPC_NOT_ENOUGH_ARGS") {
// https://bugzilla.mozilla.org/show_bug.cgi?id=794602
// XXX Always use when we no longer support Firefox < 18
wbp.saveURI(uri, null, null, null, null, fileURL, null);
}
}

View File

@ -463,7 +463,13 @@ Zotero.Sync.Storage.Session.WebDAV.prototype.downloadFile = function (request) {
.createInstance(nsIWBP);
wbp.persistFlags = nsIWBP.PERSIST_FLAGS_BYPASS_CACHE;
wbp.progressListener = listener;
wbp.saveURI(uri, null, null, null, null, destFile);
try {
wbp.saveURI(uri, null, null, null, null, destFile);
} catch(e if e.name === "NS_ERROR_XPC_NOT_ENOUGH_ARGS") {
// https://bugzilla.mozilla.org/show_bug.cgi?id=794602
// XXX Always use when we no longer support Firefox < 18
wbp.saveURI(uri, null, null, null, null, destFile, null);
}
}
catch (e) {
request.error(e);

View File

@ -315,8 +315,14 @@ Zotero.Sync.Storage.Session.ZFS.prototype.downloadFile = function (request) {
.classes["@mozilla.org/embedding/browser/nsWebBrowserPersist;1"]
.createInstance(nsIWBP);
wbp.persistFlags = nsIWBP.PERSIST_FLAGS_BYPASS_CACHE;
wbp.progressListener = listener;
wbp.saveURI(uri, null, null, null, null, destFile);
wbp.progressListener = listener;
try {
wbp.saveURI(uri, null, null, null, null, destFile);
} catch(e if e.name === "NS_ERROR_XPC_NOT_ENOUGH_ARGS") {
// https://bugzilla.mozilla.org/show_bug.cgi?id=794602
// XXX Always use when we no longer support Firefox < 18
wbp.saveURI(uri, null, null, null, null, destFile, null);
}
}
catch (e) {
self.onError(e);