Bug 1633968 - Use TabContextMenu.contextTab in ext-menus r=rpl
☠☠ backed out by 9194f91b1fa2 ☠ ☠
authorRob Wu <rob@robwu.nl>
Wed, 20 May 2020 17:05:07 +0000
changeset 531457 55cc61b65e567fdb2908b4b0f49f05c7f8164f0d
parent 531456 7daef473f5ebb2fce0b58a82972cf7b4a8079ae8
child 531458 9dc3a4d3263094dcc060339a8b18f2190a5f70c5
push id37439
push userbtara@mozilla.com
push dateThu, 21 May 2020 21:49:34 +0000
treeherdermozilla-central@92c11f0bf14b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrpl
bugs1633968
milestone78.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 1633968 - Use TabContextMenu.contextTab in ext-menus r=rpl Differential Revision: https://phabricator.services.mozilla.com/D73256
browser/components/extensions/parent/ext-menus.js
--- a/browser/components/extensions/parent/ext-menus.js
+++ b/browser/components/extensions/parent/ext-menus.js
@@ -1176,21 +1176,17 @@ const menuTracker = {
       });
     }
     if (menu.id === "menu_ToolsPopup") {
       const tab = tabTracker.activeTab;
       const pageUrl = tab.linkedBrowser.currentURI.spec;
       gMenuBuilder.build({ menu, tab, pageUrl, inToolsMenu: true });
     }
     if (menu.id === "tabContextMenu") {
-      let trigger = menu.triggerNode;
-      while (trigger && trigger.localName != "tab") {
-        trigger = trigger.parentNode;
-      }
-      const tab = trigger || tabTracker.activeTab;
+      const tab = menu.ownerGlobal.TabContextMenu.contextTab;
       const pageUrl = tab.linkedBrowser.currentURI.spec;
       gMenuBuilder.build({ menu, tab, pageUrl, onTab: true });
     }
   },
 
   onBookmarksContextMenu(event) {
     const menu = event.target;
     const tree = menu.triggerNode.parentElement;