From 3e1df554ef9b0d6ddf2b65f5f9c1d708f9a0b679 Mon Sep 17 00:00:00 2001 From: JustOff Date: Tue, 8 May 2018 14:11:37 +0300 Subject: [PATCH] Add addons.palemoon.org to the hosts being processed --- bootstrap.js | 96 ++++++++++++++++++++++++++++------------------------ 1 file changed, 51 insertions(+), 45 deletions(-) diff --git a/bootstrap.js b/bootstrap.js index 6ed0e46..fa54d4b 100644 --- a/bootstrap.js +++ b/bootstrap.js @@ -6,49 +6,51 @@ Cu.import("resource://gre/modules/AddonManager.jsm"); const branch = "extensions.ublock0-updater."; const XMLHttpRequest = CC("@mozilla.org/xmlextras/xmlhttprequest;1","nsIXMLHttpRequest"); -const u0id = "uBlock0@raymondhill.net", u0Data = ` - - - - - %VERSION% - - - {8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4} - 27.0.0 - 28.* - https://github.com/gorhill/uBlock/releases/download/firefox-legacy-%VERSION%/uBlock0.firefox-legacy.xpi - - - - - {92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a} - 2.40 - * - https://github.com/gorhill/uBlock/releases/download/firefox-legacy-%VERSION%/uBlock0.firefox-legacy.xpi - - - - - {ec8030f7-c20a-464f-9b0e-13a3a9e97384} - 45.0 - 56.* - https://github.com/gorhill/uBlock/releases/download/firefox-legacy-%VERSION%/uBlock0.firefox-legacy.xpi - - - - - {3550f703-e582-4d05-9a08-453d09bdfdc6} - 45.0 - * - https://github.com/gorhill/uBlock/releases/download/firefox-legacy-%VERSION%/uBlock0.firefox-legacy.xpi - - - - - - -`; +const u0id = "uBlock0@raymondhill.net", u0Data = ` + + + + + + %VERSION% + + + {8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4} + 27.0.0 + 28.* + https://github.com/gorhill/uBlock/releases/download/firefox-legacy-%VERSION%/uBlock0.firefox-legacy.xpi + + + + + {92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a} + 2.40 + * + https://github.com/gorhill/uBlock/releases/download/firefox-legacy-%VERSION%/uBlock0.firefox-legacy.xpi + + + + + {ec8030f7-c20a-464f-9b0e-13a3a9e97384} + 45.0 + 56.* + https://github.com/gorhill/uBlock/releases/download/firefox-legacy-%VERSION%/uBlock0.firefox-legacy.xpi + + + + + {3550f703-e582-4d05-9a08-453d09bdfdc6} + 45.0 + * + https://github.com/gorhill/uBlock/releases/download/firefox-legacy-%VERSION%/uBlock0.firefox-legacy.xpi + + + + + + + +`; var u0Beta = false, u0Ver = ""; @@ -56,7 +58,9 @@ var httpObserver = { observe: function(subject, topic, data) { if (topic == 'http-on-examine-response' || topic == 'http-on-examine-cached-response') { subject.QueryInterface(Ci.nsIHttpChannel); - if ((subject.URI.host == "versioncheck.addons.mozilla.org" || subject.URI.host == "versioncheck-bg.addons.mozilla.org") + if ((subject.URI.host == "addons.palemoon.org" || + subject.URI.host == "versioncheck.addons.mozilla.org" || + subject.URI.host == "versioncheck-bg.addons.mozilla.org") && subject.URI.path.indexOf("&id=" + u0id +"&") != -1) { checkUpdate(); subject.QueryInterface(Ci.nsITraceableChannel); @@ -108,8 +112,10 @@ TracingListener.prototype = { var upd = "", data = this.receivedData.join(""); if (u0Ver != "") { upd = u0Data.replace(/%VERSION%/g, u0Ver); + } else { + upd = ''; } - data = data.replace(//, upd); + data = data.replace(//, upd); var storageStream = CCIN("@mozilla.org/storagestream;1", "nsIStorageStream"); storageStream.init(8192, data.length, null); var os = storageStream.getOutputStream(0);