[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
This commit is contained in:
Moonchild 2023-05-18 10:14:48 +02:00 committed by roytam1
commit e3d51b39b6

View file

@ -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 = {