Bug 1641345 - Fix up firstTab browser; it is no longer stored in a WeakMap (for web ext), ensure it gets a listener. r=darktrojan a=wsmwk
authoralta88@fixall.com
Mon, 01 Jun 2020 08:04:10 -0600
changeset 39337 f6738b7e63e22e54b3c9452dd210f98a04bd17db
parent 39336 62898a2e91679fbbe40d1a2d55ac508bb4cc0cdd
child 39338 8672ba724e872a3700c9984ee266d19875529781
push id402
push userclokep@gmail.com
push dateMon, 29 Jun 2020 20:48:04 +0000
reviewersdarktrojan, wsmwk
bugs1641345
Bug 1641345 - Fix up firstTab browser; it is no longer stored in a WeakMap (for web ext), ensure it gets a listener. r=darktrojan a=wsmwk
mail/base/content/tabmail.js
--- a/mail/base/content/tabmail.js
+++ b/mail/base/content/tabmail.js
@@ -873,16 +873,24 @@
           firstTab.mode.openFirstTab || firstTab.mode.tabType.openFirstTab;
         tabOpenFirstFunc.call(firstTab.mode.tabType, firstTab);
         this.setTabTitle(null);
 
         // Set the tabId after defining a <browser> and before notifications.
         firstTab.browser = this.getBrowserForTab(firstTab);
         firstTab.browser._activeTabId = firstTab.tabId;
 
+        // Register browser progress listeners. For firstTab, it is the shared
+        // #messagepane so only do it once.
+        firstTab.browser.webProgress.addProgressListener(
+          this.progressListener,
+          Ci.nsIWebProgress.NOTIFY_ALL
+        );
+        firstTab.browser._progressListenerAdded = true;
+
         for (let tabMonitor of this.tabMonitors) {
           if ("onTabOpened" in tabMonitor) {
             tabMonitor.onTabOpened(firstTab, true);
           }
           tabMonitor.onTabSwitched(firstTab, null);
         }
 
         // Dispatch tab opening event