Bug 1516655 fix widget.node checks in browserAction code, r=rpl
authorShane Caraveo <scaraveo@mozilla.com>
Mon, 07 Jan 2019 19:38:49 +0000
changeset 509854 bfd9ddf7b03b2d0a05f61a1bb9308639dbf0a2f4
parent 509853 129a3f527c8ee2091598f5035eabe6d8da1f45dc
child 509855 837890ad49682f6fe582c748f3e5ba79c387d0fd
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrpl
bugs1516655
milestone66.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 1516655 fix widget.node checks in browserAction code, r=rpl Differential Revision: https://phabricator.services.mozilla.com/D15475
browser/components/extensions/parent/ext-browserAction.js
--- a/browser/components/extensions/parent/ext-browserAction.js
+++ b/browser/components/extensions/parent/ext-browserAction.js
@@ -242,17 +242,17 @@ this.browserAction = class extends Exten
     if (popup) {
       popup.closePopup();
       return;
     }
 
     let widget = this.widget.forWindow(window);
     let tab = window.gBrowser.selectedTab;
 
-    if (!widget || !this.getProperty(tab, "enabled")) {
+    if (!widget.node || !this.getProperty(tab, "enabled")) {
       return;
     }
 
     // Popups are shown only if a popup URL is defined; otherwise
     // a "click" event is dispatched. This is done for compatibility with the
     // Google Chrome onClicked extension API.
     if (this.getProperty(tab, "popup")) {
       if (this.widget.areaType == CustomizableUI.TYPE_MENU_PANEL) {
@@ -490,20 +490,20 @@ this.browserAction = class extends Exten
 
   /**
    * Update the toolbar button for a given window.
    *
    * @param {ChromeWindow} window
    *        Browser chrome window.
    */
   updateWindow(window) {
-    let widget = this.widget.forWindow(window);
-    if (widget) {
+    let node = this.widget.forWindow(window).node;
+    if (node) {
       let tab = window.gBrowser.selectedTab;
-      this.updateButton(widget.node, this.tabContext.get(tab));
+      this.updateButton(node, this.tabContext.get(tab));
     }
   }
 
   /**
    * Update the toolbar button when the extension changes the icon, title, url, etc.
    * If it only changes a parameter for a single tab, `target` will be that tab.
    * If it only changes a parameter for a single window, `target` will be that window.
    * Otherwise `target` will be null.