Bug 1220700 - Cannot enable add-ons installed from WebIDE r=ochameau
authorFabrice Desré <fabrice@mozilla.com>
Tue, 17 Nov 2015 11:03:44 -0800
changeset 309435 a3cd8d9dcb03499220d1352e1033634eda82ad74
parent 309434 7fed9cad6d9408cd73660c975c7276cc48e19aec
child 309436 f3db090f8285107898b7b8fdcab3efa712f1eeed
child 309573 93d3671347066a184b4325c84dfc2277000bfee8
push id7604
push usergarndt@mozilla.com
push dateTue, 17 Nov 2015 20:40:56 +0000
reviewersochameau
bugs1220700
milestone45.0a1
Bug 1220700 - Cannot enable add-ons installed from WebIDE r=ochameau
devtools/server/actors/webapps.js
toolkit/components/extensions/ext-runtime.js
--- a/devtools/server/actors/webapps.js
+++ b/devtools/server/actors/webapps.js
@@ -270,16 +270,18 @@ WebappsActor.prototype = {
     aApp.installTime = Date.now();
     aApp.installState = "installed";
     aApp.removable = true;
     aApp.id = aId;
     aApp.basePath = reg.getWebAppsBasePath();
     aApp.localId = (aId in reg.webapps) ? reg.webapps[aId].localId
                                         : reg._nextLocalId();
     aApp.sideloaded = true;
+    aApp.enabled = true;
+    aApp.blockedStatus = Ci.nsIBlocklistService.STATE_NOT_BLOCKED;
 
     reg.webapps[aId] = aApp;
     reg.updatePermissionsForApp(aId);
 
     reg._readManifests([{ id: aId }]).then((aResult) => {
       let manifest = aResult[0].manifest;
       aApp.name = manifest.name;
       aApp.csp = manifest.csp || "";
--- a/toolkit/components/extensions/ext-runtime.js
+++ b/toolkit/components/extensions/ext-runtime.js
@@ -1,10 +1,11 @@
 var { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
+Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
                                   "resource://gre/modules/AppConstants.jsm");
 
 Cu.import("resource://gre/modules/ExtensionUtils.jsm");
 var {
   EventManager,
   ignoreEvent,
   runSafe,