diff --git a/dom/apps/Webapps.jsm b/dom/apps/Webapps.jsm index 3432f88bdd3..b22224af8ea 100644 --- a/dom/apps/Webapps.jsm +++ b/dom/apps/Webapps.jsm @@ -738,7 +738,11 @@ this.DOMApplicationRegistry = { loadAndUpdateApps: function() { return Task.spawn(function*() { - let runUpdate = AppsUtils.isFirstRun(Services.prefs); + let runUpdate = false; + try { + runUpdate = AppsUtils.isFirstRun(Services.prefs); + } catch(e) {} + let loadAppPermission = Services.prefs.getBoolPref("dom.apps.reset-permissions"); yield this.loadCurrentRegistry(); @@ -801,7 +805,7 @@ this.DOMApplicationRegistry = { // installPreinstalledApp() removes the ones failing to install. this._saveApps(); - Services.prefs.setBoolPref("dom.apps.reset-permissions", true); + Services.prefs.setBoolPref("dom.apps.reset-permissions", true); } // DataStores must be initialized at startup. @@ -4335,27 +4339,6 @@ this.DOMApplicationRegistry = { }); }, - getAll: function(aCallback) { - debug("getAll"); - let apps = []; - let tmp = []; - - for (let id in this.webapps) { - let app = AppsUtils.cloneAppObject(this.webapps[id]); - if (!this._isLaunchable(app)) - continue; - - apps.push(app); - tmp.push({ id: id }); - } - - this._readManifests(tmp).then((aResult) => { - for (let i = 0; i < aResult.length; i++) - apps[i].manifest = aResult[i].manifest; - aCallback(apps); - }); - }, - /* Check if |data| is actually a receipt */ isReceipt: function(data) { try { diff --git a/toolkit/devtools/server/actors/webapps.js b/toolkit/devtools/server/actors/webapps.js index 76f9612864e..c00ecb25109 100644 --- a/toolkit/devtools/server/actors/webapps.js +++ b/toolkit/devtools/server/actors/webapps.js @@ -214,6 +214,9 @@ function WebappsActor(aConnection) { Cu.import("resource://gre/modules/FileUtils.jsm"); Cu.import("resource://gre/modules/MessageBroadcaster.jsm"); + this.appsChild = {}; + Cu.import("resource://gre/modules/AppsServiceChild.jsm", this.appsChild); + // Keep reference of already connected app processes. // values: app frame message manager this._connectedApps = new Set(); @@ -688,8 +691,7 @@ WebappsActor.prototype = { debug("getAll"); let deferred = promise.defer(); - let reg = DOMApplicationRegistry; - reg.getAll(apps => { + this.appsChild.DOMApplicationRegistry.getAll(apps => { deferred.resolve({ apps: this._filterAllowedApps(apps) }); });