commit 42215d0441965099a67aba9f617061388ef62591
parent b6fee9a3577de8e56e80e107cd20e9b21a5d95bb
Author: Simon Kornblith <simon@simonster.com>
Date: Mon, 12 Nov 2012 01:10:32 -0500
More saveURI fixes
Diffstat:
3 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/chrome/content/zotero/preferences/preferences.js b/chrome/content/zotero/preferences/preferences.js
@@ -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);
+ }
}
diff --git a/chrome/content/zotero/xpcom/storage/webdav.js b/chrome/content/zotero/xpcom/storage/webdav.js
@@ -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);
diff --git a/chrome/content/zotero/xpcom/storage/zfs.js b/chrome/content/zotero/xpcom/storage/zfs.js
@@ -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);