Bug 1344408 fix eager loading of CUI, r?kmag draft
authorShane Caraveo <scaraveo@mozilla.com>
Fri, 03 Mar 2017 16:15:06 -0800
changeset 493445 d6ae6989cfef4074552813f582644949e98412f4
parent 492009 d29f84406483c721a13cf9a52936ecced0c5c98a
child 493446 0559ca0a57fc77a8cef7afbdcfbb28a8247abd05
push id47765
push usermixedpuppy@gmail.com
push dateSat, 04 Mar 2017 00:17:04 +0000
reviewerskmag
bugs1344408
milestone54.0a1
Bug 1344408 fix eager loading of CUI, r?kmag MozReview-Commit-ID: DX2fB5cGNB0
browser/components/extensions/ext-browserAction.js
--- a/browser/components/extensions/ext-browserAction.js
+++ b/browser/components/extensions/ext-browserAction.js
@@ -35,22 +35,24 @@ function isAncestorOrSelf(target, node) 
     }
   }
   return false;
 }
 
 // WeakMap[Extension -> BrowserAction]
 const browserActionMap = new WeakMap();
 
-const browserAreas = {
-  "navbar": CustomizableUI.AREA_NAVBAR,
-  "menupanel": CustomizableUI.AREA_PANEL,
-  "tabstrip": CustomizableUI.AREA_TABSTRIP,
-  "personaltoolbar": CustomizableUI.AREA_BOOKMARKS,
-};
+XPCOMUtils.defineLazyGetter(this, "browserAreas", () => {
+  return {
+    "navbar": CustomizableUI.AREA_NAVBAR,
+    "menupanel": CustomizableUI.AREA_PANEL,
+    "tabstrip": CustomizableUI.AREA_TABSTRIP,
+    "personaltoolbar": CustomizableUI.AREA_BOOKMARKS,
+  };
+});
 
 // Responsible for the browser_action section of the manifest as well
 // as the associated popup.
 function BrowserAction(options, extension) {
   this.extension = extension;
 
   let widgetId = makeWidgetId(extension.id);
   this.id = `${widgetId}-browser-action`;