From 11d65297503eb044a8a8567dbde4bfc18b147839 Mon Sep 17 00:00:00 2001 From: Basilisk-Dev Date: Tue, 11 Jul 2023 18:01:33 -0400 Subject: [PATCH] [Basilisk] Add pref to control history menu length. Backport of MoonchildProductions/Pale-Moon commit d7581957ff --- application/basilisk/base/content/browser-places.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/application/basilisk/base/content/browser-places.js b/application/basilisk/base/content/browser-places.js index a7f33b10c1..474053510c 100644 --- a/application/basilisk/base/content/browser-places.js +++ b/application/basilisk/base/content/browser-places.js @@ -717,9 +717,13 @@ function HistoryMenu(aPopupShowingEvent) { // 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; + 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 = { _getClosedTabCount() {