This script will clean-up Mozilla Firefox History (Crash, Telemetry and Profile lock files, DOM Storage, Cookies, Site-specific preferences, Saved form data, Autocomplete history) and optimizes and shrinks all sqlite files.
Extract the complete archive (including sqlite3.exe) to the Scripts folder of Cleanmgr+
SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. Mozilla Firefox store its history in a file called places.sqlite in the Profile folder. You can directly manipulate the SQLite database and also optimize/shrink it or let Cleanmgr+ do this for you.
More information about the places.sqlite can be found here.