diff --git a/helpers/DATA/firefox/onboarding/bootstrap.js b/helpers/DATA/firefox/onboarding/bootstrap.js index 1dc6938f420a522dedc4a3e0ced68f2a0955fe34..ea97a204ff54b516f922c69bdecf275295a6c142 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 0990aa8bf97d8fdb5fb4534c64eecdb8a3276203..9428f2030d62a42c2c32535716368f72084a9745 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