From e586645469bc7fee4744b8e16b7ccbc7dc2ca5dc Mon Sep 17 00:00:00 2001 From: Ruben Rodriguez <ruben@trisquel.info> Date: Fri, 27 Jul 2018 17:11:41 -0400 Subject: [PATCH] Abrowser: updated bootstrap.js due to upstream changes --- helpers/DATA/firefox/onboarding/bootstrap.js | 40 ++++++++------------ helpers/make-firefox | 2 +- 2 files changed, 16 insertions(+), 26 deletions(-) diff --git a/helpers/DATA/firefox/onboarding/bootstrap.js b/helpers/DATA/firefox/onboarding/bootstrap.js index 1dc6938f..ea97a204 100644 --- a/helpers/DATA/firefox/onboarding/bootstrap.js +++ b/helpers/DATA/firefox/onboarding/bootstrap.js @@ -16,6 +16,12 @@ XPCOMUtils.defineLazyModuleGetters(this, { AddonManager: "resource://gre/modules/AddonManager.jsm", }); +XPCOMUtils.defineLazyServiceGetter(this, "resProto", + "@mozilla.org/network/protocol;1?name=resource", + "nsISubstitutingProtocolHandler"); + +const RESOURCE_HOST = "onboarding"; + const {PREF_STRING, PREF_BOOL, PREF_INT} = Ci.nsIPrefBranch; const BROWSER_READY_NOTIFICATION = "browser-delayed-startup-finished"; @@ -50,24 +56,9 @@ function setPrefs(type, name, value) { } } +async function flip(id){ + var addonObj = await AddonManager.getAddonByID(id); -/** - * Listen and process events from content. - */ -function initContentMessageListener() { - Services.mm.addMessageListener("Onboarding:OnContentMessage", msg => { - setPrefs(type, name, value); - }); -} - -function flip(id){ - var addonObj=-1; - AddonManager.getAddonByID(id, function(addon) { - addonObj=addon; - }); - var thread = Components.classes["@mozilla.org/thread-manager;1"].getService().currentThread; - while (addonObj == null || addonObj == -1) - thread.processNextEvent(true); addonObj.userDisabled = addonObj.isActive; if ( addonObj.operationsRequiringRestart != 0) Services.mm.broadcastAsyncMessage("Onboarding:needsrestart"); @@ -78,14 +69,9 @@ function flip(id){ }); } -function checkaddon(id){ - var addonObj=-1; - AddonManager.getAddonByID(id, function(addon) { - addonObj=addon; - }); - var thread = Components.classes["@mozilla.org/thread-manager;1"].getService().currentThread; - while (addonObj == -1) - thread.processNextEvent(true); +async function checkaddon(id){ + var addonObj = await AddonManager.getAddonByID(id); + if (addonObj != null) Services.mm.broadcastAsyncMessage("Onboarding:message-from-chrome", { id : id, @@ -156,6 +142,10 @@ function install(aData, aReason) {} function uninstall(aData, aReason) {} function startup(aData, aReason) { + resProto.setSubstitutionWithFlags(RESOURCE_HOST, + Services.io.newURI("chrome/content/", null, aData.resourceURI), + resProto.ALLOW_CONTENT_ACCESS); + // Cache startup data which contains stuff like the version number, etc. // so we can use it when we init the telemetry startupData = aData; diff --git a/helpers/make-firefox b/helpers/make-firefox index 0990aa8b..9428f203 100644 --- a/helpers/make-firefox +++ b/helpers/make-firefox @@ -18,7 +18,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -VERSION=58 +VERSION=59 . ./config -- GitLab