Bug 1344408 fix eager loading of CUI, r=kmag
authorShane Caraveo <scaraveo@mozilla.com>
Fri, 03 Mar 2017 16:15:06 -0800
changeset 345916 a4cf39b772dfec2ac2710e51f920789672332106
parent 345915 0f6c81e7bb41d55bcf629c2f4e5f16efbcf1c238
child 345917 b691557cb7a31c942cbdf3c1388140f60c24fdf9
push id31451
push usercbook@mozilla.com
push dateMon, 06 Mar 2017 09:52:09 +0000
treeherdermozilla-central@7099e03837e8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag
bugs1344408
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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`;