From 3387ed0b291d3ae4836e3a2041acc49d52d13a78 Mon Sep 17 00:00:00 2001 From: Uli Heller Date: Wed, 8 Aug 2018 08:21:21 +0200 Subject: Compatibility with thunderbird-60, fixes #55 --- src/components/nsNextcloud.js | 19 +++++++------------ src/install.rdf | 4 ++-- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/components/nsNextcloud.js b/src/components/nsNextcloud.js index 69af4fa..e5bc7e3 100644 --- a/src/components/nsNextcloud.js +++ b/src/components/nsNextcloud.js @@ -35,6 +35,7 @@ Cu.import("resource:///modules/oauth.jsm"); Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource:///modules/gloda/log4moz.js"); Cu.import("resource:///modules/cloudFileAccounts.js"); +Cu.importGlobalProperties(["XMLHttpRequest"]); const kRestBase = "/ocs/v1.php"; const kAuthPath = kRestBase + "/cloud/user"; @@ -435,8 +436,7 @@ Nextcloud.prototype = { this.log.info("Sending login information..."); let args = "?format=json"; - let req = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"] - .createInstance(Ci.nsIXMLHttpRequest); + let req = new XMLHttpRequest(Ci.nsIXMLHttpRequest); req.open("GET", this._fullUrl + kAuthPath + args, true); req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); @@ -575,8 +575,7 @@ Nextcloud.prototype = { '' + ''; - let req = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance( - Ci.nsIXMLHttpRequest); + let req = new XMLHttpRequest(Ci.nsIXMLHttpRequest); req.open("PROPFIND", this._fullUrl + kWebDavPath, true, this._userName, this._password); @@ -638,8 +637,7 @@ Nextcloud.prototype = { '' + ''; - let req = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"] - .createInstance(Ci.nsIXMLHttpRequest); + let req = new XMLHttpRequest(Ci.nsIXMLHttpRequest); req.open("PROPFIND", this._fullUrl + kWebDavPath + ("/" + this._storageFolder + "/").replace(/\/+/g, '/'), true, this._userName, @@ -674,8 +672,7 @@ Nextcloud.prototype = { */ _createFolder: function createFolder(callback) { if (this._storageFolder !== '/') { - let req = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"] - .createInstance(Ci.nsIXMLHttpRequest); + let req = new XMLHttpRequest(Ci.nsIXMLHttpRequest); req.open("MKCOL", this._fullUrl + kWebDavPath + ("/" + this._storageFolder + "/").replace(/\/+/g, '/'), true, this._userName, @@ -778,8 +775,7 @@ NextcloudFileUploader.prototype = { bufStream = bufStream.QueryInterface(Ci.nsIInputStream); let contentLength = fstream.available(); - let req = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance( - Ci.nsIXMLHttpRequest); + let req = new XMLHttpRequest(Ci.nsIXMLHttpRequest); req.open("PUT", url, true, this._userName, this._password); @@ -835,8 +831,7 @@ NextcloudFileUploader.prototype = { this.file = aFile; let shareType = 3; let args = "?format=json"; - let req = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"] - .createInstance(Ci.nsIXMLHttpRequest); + let req = new XMLHttpRequest(Ci.nsIXMLHttpRequest); let path = wwwFormUrlEncode( ("/" + this.nextcloud._storageFolder + "/").replace(/\/+/g, '/') + this._fileUploadTS[this.file.path] + "_" + this.file.leafName); diff --git a/src/install.rdf b/src/install.rdf index 785c678..f12a70c 100644 --- a/src/install.rdf +++ b/src/install.rdf @@ -6,7 +6,7 @@ owncloud@viguierjust.com Nextcloud for Filelink - 1.7 + 1.7.1 2 Olivier Paroz Philipp Kewisch @@ -21,7 +21,7 @@ {3550f703-e582-4d05-9a08-453d09bdfdc6} 17.0 - 57.* + 60.* -- cgit v1.2.3