Bug 1635019 - Fix "container is undefined" error in panelUI.js. r=mkmelin a=wsmwk
authorGeoff Lankow <geoff@darktrojan.net>
Mon, 22 Jun 2020 13:29:59 +0300
changeset 39459 5eb5649458a837546fa140ce87ece3cdac246f8b
parent 39458 15c8fba4b027d77553fab81b166962773e105f71
child 39460 cf9b631ce5fa129d7852a8efa21720602d97a31f
push id402
push userclokep@gmail.com
push dateMon, 29 Jun 2020 20:48:04 +0000
reviewersmkmelin, wsmwk
bugs1635019
Bug 1635019 - Fix "container is undefined" error in panelUI.js. r=mkmelin a=wsmwk
mail/base/content/messageWindow.js
mail/base/content/msgMail3PaneWindow.js
mail/components/customizableui/content/panelUI.js
--- a/mail/base/content/messageWindow.js
+++ b/mail/base/content/messageWindow.js
@@ -4,29 +4,29 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* This is where functions related to the standalone message window are kept */
 
 /* import-globals-from ../../../../toolkit/components/printing/content/printUtils.js */
 /* import-globals-from ../../../../toolkit/content/viewZoomOverlay.js */
 /* import-globals-from ../../../mailnews/base/content/junkCommands.js */
 /* import-globals-from ../../../mailnews/base/prefs/content/accountUtils.js */
+/* import-globals-from ../../components/customizableui/content/panelUI.js */
 /* import-globals-from commandglue.js */
 /* import-globals-from folderDisplay.js */
 /* import-globals-from mail-offline.js */
 /* import-globals-from mailCommands.js */
 /* import-globals-from mailCore.js */
 /* import-globals-from mailWindow.js */
 /* import-globals-from mailWindowOverlay.js */
 /* import-globals-from messageDisplay.js */
 /* import-globals-from msgHdrView.js */
 /* import-globals-from msgViewNavigation.js */
 /* import-globals-from phishingDetector.js */
 /* import-globals-from toolbarIconColor.js */
-/* globals PanelUI */
 
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 var { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
 var { AppConstants } = ChromeUtils.import(
   "resource://gre/modules/AppConstants.jsm"
 );
 var { MailConstants } = ChromeUtils.import(
   "resource:///modules/MailConstants.jsm"
@@ -274,16 +274,17 @@ StandaloneMessageDisplayWidget.prototype
 
     this.isDummy = aMsgHdr.folder == null;
     if (!this.isDummy) {
       this.displayedUri = null;
     }
 
     // Initialize the appmenu.
     PanelUI.init();
+    gExtensionsNotifications.init();
 
     // We've loaded a message, so this should be set to false
     this.aboutToLoadMessage = false;
   },
 
   onSelectedMessagesChanged() {
     // When switching folders, we won't have any selection for a while.
     if (!this.folderDisplay.view.dbView) {
--- a/mail/base/content/msgMail3PaneWindow.js
+++ b/mail/base/content/msgMail3PaneWindow.js
@@ -2,32 +2,32 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* import-globals-from ../../../../toolkit/modules/PageMenu.jsm */
 /* import-globals-from ../../../calendar/base/content/calendar-chrome-startup.js */
 /* import-globals-from ../../../mailnews/base/prefs/content/accountUtils.js */
 /* import-globals-from ../../../mailnews/base/util/MailnewsMigrator.jsm */
+/* import-globals-from ../../components/customizableui/content/panelUI.js */
 /* import-globals-from ../../components/newmailaccount/content/accountProvisionerTab.js */
 /* import-globals-from ../../components/preferences/preferencesTab.js */
-/* import-globals-from messenger-customization.js */
+/* import-globals-from ../../extensions/openpgp/content/BondOpenPGP.jsm */
 /* import-globals-from commandglue.js */
 /* import-globals-from folderDisplay.js */
 /* import-globals-from folderPane.js */
 /* import-globals-from glodaFacetTab.js */
 /* import-globals-from mailTabs.js */
 /* import-globals-from mailWindow.js */
+/* import-globals-from messenger-customization.js */
 /* import-globals-from quickFilterBar.js */
 /* import-globals-from searchBar.js */
 /* import-globals-from searchBar.js */
 /* import-globals-from specialTabs.js */
 /* import-globals-from toolbarIconColor.js */
-/* import-globals-from ../../extensions/openpgp/content/BondOpenPGP.jsm */
-/* globals PanelUI */
 
 ChromeUtils.import("resource:///modules/activity/activityModules.jsm");
 var { logException } = ChromeUtils.import("resource:///modules/ErrUtils.jsm");
 var { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.jsm");
 var { JSTreeSelection } = ChromeUtils.import(
   "resource:///modules/JsTreeSelection.jsm"
 );
 var { MailConsts } = ChromeUtils.import("resource:///modules/MailConsts.jsm");
@@ -591,16 +591,17 @@ function OnLoadMessenger() {
   gSummaryFrameManager = new SummaryFrameManager(
     document.getElementById("multimessage")
   );
 
   window.addEventListener("AppCommand", HandleAppCommandEvent, true);
 
   // Set up the appmenus. (This has to happen after the DOM has loaded.)
   PanelUI.init();
+  gExtensionsNotifications.init();
 
   // Load the periodic filter timer.
   PeriodicFilterManager.setupFiltering();
 
   let pService = Cc["@mozilla.org/toolkit/profile-service;1"].getService(
     Ci.nsIToolkitProfileService
   );
   if (pService.createdAlternateProfile) {
--- a/mail/components/customizableui/content/panelUI.js
+++ b/mail/components/customizableui/content/panelUI.js
@@ -1380,12 +1380,11 @@ var gExtensionsNotifications = {
         // unable to identify which panel should be closed automatically.
         PanelUI.hide();
         ExtensionsUI.showSideloaded(tabmail.selectedBrowser, addon);
       });
     }
   },
 };
 
-addEventListener("load", () => gExtensionsNotifications.init(), { once: true });
 addEventListener("unload", () => gExtensionsNotifications.uninit(), {
   once: true,
 });