From b55e6536ec55e86a97d20c18df3e73173bf96854 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 23 Sep 2015 05:02:40 -0400 Subject: [PATCH] Fix login manager (and syncing) breakage in Firefox 41 --- chrome/content/zotero/xpcom/storage/webdav.js | 7 +++---- chrome/content/zotero/xpcom/sync.js | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/chrome/content/zotero/xpcom/storage/webdav.js b/chrome/content/zotero/xpcom/storage/webdav.js index dc9843db5a..91cec953ca 100644 --- a/chrome/content/zotero/xpcom/storage/webdav.js +++ b/chrome/content/zotero/xpcom/storage/webdav.js @@ -31,7 +31,7 @@ Zotero.Sync.Storage.WebDAV = (function () { var _cachedCredentials = false; var _loginManagerHost = 'chrome://zotero'; - var _loginManagerURL = 'Zotero Storage Server'; + var _loginManagerURL = '/'; var _lastSyncIDLength = 30; @@ -699,7 +699,7 @@ Zotero.Sync.Storage.WebDAV = (function () { Zotero.debug('Getting WebDAV password'); var loginManager = Components.classes["@mozilla.org/login-manager;1"] .getService(Components.interfaces.nsILoginManager); - var logins = loginManager.findLogins({}, _loginManagerHost, _loginManagerURL, null); + var logins = loginManager.findLogins({}, _loginManagerHost, "", null); // Find user from returned array of nsILoginInfo objects for (var i = 0; i < logins.length; i++) { @@ -722,7 +722,7 @@ Zotero.Sync.Storage.WebDAV = (function () { var loginManager = Components.classes["@mozilla.org/login-manager;1"] .getService(Components.interfaces.nsILoginManager); - var logins = loginManager.findLogins({}, _loginManagerHost, _loginManagerURL, null); + var logins = loginManager.findLogins({}, _loginManagerHost, "", null); for (var i = 0; i < logins.length; i++) { Zotero.debug('Clearing WebDAV passwords'); @@ -731,7 +731,6 @@ Zotero.Sync.Storage.WebDAV = (function () { } if (password) { - Zotero.debug(_loginManagerURL); var nsLoginInfo = new Components.Constructor("@mozilla.org/login-manager/loginInfo;1", Components.interfaces.nsILoginInfo, "init"); var loginInfo = new nsLoginInfo(_loginManagerHost, _loginManagerURL, diff --git a/chrome/content/zotero/xpcom/sync.js b/chrome/content/zotero/xpcom/sync.js index f2a9fc3249..a338bd3ad8 100644 --- a/chrome/content/zotero/xpcom/sync.js +++ b/chrome/content/zotero/xpcom/sync.js @@ -1235,7 +1235,7 @@ Zotero.Sync.Server = new function () { var loginManager = Components.classes["@mozilla.org/login-manager;1"] .getService(Components.interfaces.nsILoginManager); try { - var logins = loginManager.findLogins({}, _loginManagerHost, _loginManagerURL, null); + var logins = loginManager.findLogins({}, _loginManagerHost, "", null); } catch (e) { Zotero.debug(e); @@ -1273,7 +1273,7 @@ Zotero.Sync.Server = new function () { var loginManager = Components.classes["@mozilla.org/login-manager;1"] .getService(Components.interfaces.nsILoginManager); - var logins = loginManager.findLogins({}, _loginManagerHost, _loginManagerURL, null); + var logins = loginManager.findLogins({}, _loginManagerHost, "", null); for (var i = 0; i < logins.length; i++) { Zotero.debug('Clearing Zotero sync credentials'); loginManager.removeLogin(logins[i]); @@ -1332,7 +1332,7 @@ Zotero.Sync.Server = new function () { this.apiVersion = 9; var _loginManagerHost = 'chrome://zotero'; - var _loginManagerURL = 'Zotero Sync Server'; + var _loginManagerURL = '/'; var _serverURL = ZOTERO_CONFIG.SYNC_URL;