Skip to content

Wrapper for building CLI utilities with niche functions related to Mozilla profile directory management.

License

Notifications You must be signed in to change notification settings

Alhadis/Mozilla-Profile-Tools

Repository files navigation

Mozilla profile tools

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.

Usage

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.

Mirrors

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

  1. 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).

  2. https://bit.ly/41NXOC7
    Shortlink to toolkit/mozapps/update/common/commonupdatedir.cpp (revision 2fcb225) in the online code browser for the mozilla-central repository.

About

Wrapper for building CLI utilities with niche functions related to Mozilla profile directory management.

Topics

Resources

License

Stars

Watchers

Forks