This repository contains build instructions for two extremely niche utilities:
-
mozinstallhash
: A program to compute the hash used in Mozilla installation profile names. These form part of the unique identifier strings that represent a user profile directory (e.g., in~/Application Support/Firefox/Profiles/
). 12 -
mozlz4
: A program to compress and decompress files using Mozilla's variant of the LZ4 algorithm. This is used by (recent) releases of Firefox to compress certain JSON files in user profile directories.
Both of these tools reference poorly-documented facilities in Mozilla's codebase that are of interest to those who programmatically manipulate their user profile directories outside of Firefox.
Building these tools requires Go (v1.15 or newer) and Rust (v1.61 or newer). To build and install them, run:
$ make all
$ make install # Default install locations
$ make bindir=/path/to/dir install # Specify location of installed binaries
The make install
step is optional and requires a BSD-style install(1)
to
be available on the user's system. Users can "install" the binaries simply using
mv(1)
; no other files are required to run the programs once they're built.
In the event that an upstream repository "disappears", a copy of its source code (possibly outdated) can be found in a detached branch of this repository. To use these backups, modifications to the source code may be required (details of such changes are beyond the scope of this document).
Footnotes
-
https://github.com/twpayne/chezmoi/issues/1226#issuecomment-867228095
A well-researched overview of Mozilla's use of hashing to generate profile ID strings. Courtesy of @bradenhilton, who also authored the Go code used by this repository (with minor modifications). ↩ -
https://bit.ly/41NXOC7
Shortlink totoolkit/mozapps/update/common/commonupdatedir.cpp
(revision 2fcb225) in the online code browser for themozilla-central
repository. ↩