From 075eebec12a69fc3c01c6c4ade87733fc90b9295 Mon Sep 17 00:00:00 2001 From: Job Bautista Date: Thu, 18 May 2023 17:03:08 +0800 Subject: [PATCH] [Pale-Moon] Issue #1925 - Follow-up: Don't show link items when pref is less than 1. A user setting the pref to 0 most likely wants to get rid of the items, so let's allow that by simply not calling PlacesMenu.call at all in that case. --- .../palemoon/base/content/browser-places.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/application/palemoon/base/content/browser-places.js b/application/palemoon/base/content/browser-places.js index e3508ef553..c861c41607 100644 --- a/application/palemoon/base/content/browser-places.js +++ b/application/palemoon/base/content/browser-places.js @@ -504,13 +504,16 @@ 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; + 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()); } - PlacesMenu.call(this, aPopupShowingEvent, - "place:sort=4&maxResults=" + maxResults.toString().trim()); } HistoryMenu.prototype = {