Bug 632411 - Huge context menu pops up when right click after selected text in sidebar web page.
authorMarco Bonardo <mbonardo@mozilla.com>
Thu, 10 Feb 2011 14:17:54 +0100
changeset 62295 98cf4955a4b59b9c2dca36637b5b456645c88c35
parent 62294 afb62e95311a2ca29ccf89087591461fdd1f4ddb
child 62296 7698f12bbe7d92ca94e150ab94e2571cc1326773
push id18683
push usermak77@bonardo.net
push dateThu, 10 Feb 2011 13:18:18 +0000
treeherdermozilla-central@98cf4955a4b5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs632411
milestone2.0b12pre
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 632411 - Huge context menu pops up when right click after selected text in sidebar web page. r=mano a=blocker
browser/base/content/browser-places.js
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -472,26 +472,29 @@ var PlacesCommandHook = {
       organizer.PlacesOrganizer.selectLeftPaneQuery(aLeftPaneRoot);
       organizer.focus();
     }
   }
 };
 
 // View for the history menu.
 function HistoryMenu(aPopupShowingEvent) {
+  // Workaround for Bug 610187.  The sidebar does not include all the Places
+  // views definitions, and we don't need them there.
+  // Defining the prototype inheritance in the prototype itself would cause
+  // browser.js to halt on "PlacesMenu is not defined" error.
+  this.__proto__.__proto__ = PlacesMenu.prototype;
   XPCOMUtils.defineLazyServiceGetter(this, "_ss",
                                      "@mozilla.org/browser/sessionstore;1",
                                      "nsISessionStore");
   PlacesMenu.call(this, aPopupShowingEvent,
                   "place:redirectsMode=2&sort=4&maxResults=10");
 }
 
 HistoryMenu.prototype = {
-  __proto__: PlacesMenu.prototype,
-
   toggleRecentlyClosedTabs: function HM_toggleRecentlyClosedTabs() {
     // enable/disable the Recently Closed Tabs sub menu
     var undoMenu = this._rootElt.getElementsByClassName("recentlyClosedTabsMenu")[0];
 
     // no restorable tabs, so disable menu
     if (this._ss.getClosedTabCount(window) == 0)
       undoMenu.setAttribute("disabled", true);
     else