Merge remote-tracking branch 'origin/tracking' into custom

This commit is contained in:
roytam1 2023-06-02 10:39:38 +08:00
commit 0c3fa71099
7 changed files with 52 additions and 7 deletions

View file

@ -504,8 +504,22 @@ function HistoryMenu(aPopupShowingEvent) {
XPCOMUtils.defineLazyServiceGetter(this, "_ss",
"@mozilla.org/browser/sessionstore;1",
"nsISessionStore");
PlacesMenu.call(this, aPopupShowingEvent,
"place:sort=4&maxResults=15");
let maxResults = Services.prefs.getIntPref("browser.history.menuMaxResults", 15);
if (maxResults < 0) {
Components.utils.reportError("Maximum number of history menu entries is invalid! Using defaults.");
maxResults = 15;
}
if (maxResults > 0) {
if (maxResults > 50) {
// Return to sanity...
Components.utils.reportError("Maximum number of history menu entries is too large! Capping to 50.");
maxResults = 50;
}
PlacesMenu.call(this, aPopupShowingEvent,
"place:sort=4&maxResults=" + maxResults.toString().trim());
} else {
// maxResults == 0; do nothing. This suppresses the history entries.
}
}
HistoryMenu.prototype = {