How do I set how many URLs (maximum) can be stored in the browsing history of Firefox?
I don't see such an option in the settings dialog.
NOTE: I'm using Firefox 40.0.3 here.
I believe the relevant option is
places.history.expiration.max_pages. It doesn't exist by default, so you'll have to go to about:config and create it.
Once you create it and set it, check the value of
places.history.expiration.transient_current_max_pages — it should automatically adjust itself to match your
.max_pages setting. If this is the case, it means you've set
(Now on Firefox 52.0.2)
It's 2017 and since I wrote this answer I don't seem to have lost any history. My oldest history entries (from 2013) are still there. I have well over 100,000 pages in history and my "places.sqlite" is 71 MB.
The relevant function is
PEX__loadPrefs() in nsPlacesExpiration.js. It tries to determine the limit by first checking
PREF_MAX_URIS (which is
PREF_MAX_URIS isn't set or is a negative value, it then attempts to calculate the 'optimal database size' based on available memory and disc space. So, it appears that setting
places.history.expiration.max_pages overrides all this logic.
If you want it to retain all history ('infinite' history) you could try setting
max_pages to 2147483647 (the highest 32-bit signed integer). I haven't actually tested this myself, but the database would probably be crushed under its own weight before reaching this limit.