From ab1a1e893f9b7f29e59d74138cf9024ee3105c46 Mon Sep 17 00:00:00 2001 From: Basilisk-Dev Date: Tue, 11 Jul 2023 18:03:04 -0400 Subject: [PATCH] [Basilisk] Follow-up: Don't show link items when pref is less than 1. Backport of MoonchildProductions/Pale-Moon commit 1e7f19afdf --- .../basilisk/base/content/browser-places.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/application/basilisk/base/content/browser-places.js b/application/basilisk/base/content/browser-places.js index 474053510c..e6ad83deff 100644 --- a/application/basilisk/base/content/browser-places.js +++ b/application/basilisk/base/content/browser-places.js @@ -717,13 +717,15 @@ 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=" + maxResults.toString().trim()); } + let maxResults = Services.prefs.getIntPref("browser.history.menuMaxResults", 15); + // Workaround so that maxResults = 0 wouldn't create unlimited items + if (maxResults > 0) { + if (maxResults > 50) { + // Return to sanity... + maxResults = 15; + } + PlacesMenu.call(this, aPopupShowingEvent, + "place:sort=4&maxResults=" + maxResults.toString().trim()); HistoryMenu.prototype = { _getClosedTabCount() {