Update tabCloser to take into account changes from bug 554165 (easier way to access the tab strip context menu)
authorGavin Sharp <gavin@gavinsharp.com>
Thu, 25 Mar 2010 15:03:20 -0400
changeset 14 d9eb37c90121
parent 13 3b5a6ceb7e0f
child 15 05dbcf64ed71
push id15
push usergsharp@mozilla.com
push dateThu, 25 Mar 2010 19:03:25 +0000
bugs554165
Update tabCloser to take into account changes from bug 554165 (easier way to access the tab strip context menu)
content/overlay.js
--- a/content/overlay.js
+++ b/content/overlay.js
@@ -35,17 +35,18 @@
  * ***** END LICENSE BLOCK ***** */
 
 var tabcloser = {
   onLoad: function() {
     // initialization code
     this.initialized = true;
     this.strings = document.getElementById("tabcloser-strings");
 
-    this.tabMenu = document.getAnonymousElementByAttribute(getBrowser(), "anonid", "tabContextMenu");
+    this.tabMenu = getBrowser().tabContextMenu ||
+                   document.getAnonymousElementByAttribute(getBrowser(), "anonid", "tabContextMenu");
     var self = this;
     this.tabMenu.addEventListener("popupshowing", function() { self.onMenuShowing(); }, false);
 
     // Add the menu item
     var closeTabMenuitem = this.tabMenu.getElementsByAttribute("id",
                                                           "context_closeTab")[0];
     var newButton = document.createElement("menuitem");
     newButton.setAttribute("accesskey",