From e3d51b39b6b9c296715bc0bb0ffdbf6cb8819c73 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Thu, 18 May 2023 10:14:48 +0200 Subject: [PATCH] [Pale-Moon] Issue #1925 - Add pref to control history menu length. Limits set are minimum 1 entry (0 would mean unlimited so this can't be used to completely remove the history list from the menu) and maximum 50 which would overflow on most screens anyway. Default remains 15 if undefined. Resolves #1925 --- application/palemoon/base/content/browser-places.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/application/palemoon/base/content/browser-places.js b/application/palemoon/base/content/browser-places.js index 4283ad25c2..e3508ef553 100644 --- a/application/palemoon/base/content/browser-places.js +++ b/application/palemoon/base/content/browser-places.js @@ -504,8 +504,13 @@ function HistoryMenu(aPopupShowingEvent) { XPCOMUtils.defineLazyServiceGetter(this, "_ss", "@mozilla.org/browser/sessionstore;1", "nsISessionStore"); + let maxResults = Services.prefs.getIntPref("browser.history.menuMaxResults",15); + if (maxResults < 1 || maxResults > 50) { + // Return to sanity... + maxResults = 15; + } PlacesMenu.call(this, aPopupShowingEvent, - "place:sort=4&maxResults=15"); + "place:sort=4&maxResults=" + maxResults.toString().trim()); } HistoryMenu.prototype = {