ffcv
Firefox Configuration Viewer - Parse and query Firefox preference files with ease.
ffcv is both a command-line tool and a Rust library for working with Firefox's prefs.js configuration files. It provides a structured way to parse, query, and understand Firefox settings across all platforms (Linux, macOS, Windows).
Features
- Complete Parsing - Handles all Firefox preference types:
- User preferences (
user_pref) - Default preferences (
pref) - Locked preferences (
lock_pref) - Sticky preferences (
sticky_pref)
- User preferences (
- Powerful Querying - Filter preferences using glob patterns like
"network.*"or"browser.*.enabled" - Cross-Platform - Automatic Firefox profile discovery on Linux, macOS, and Windows
- Rich Data Types - Supports boolean, integer, float, string, and null values
- Human-Readable Explanations - Optional explanations for what preferences do
- Flexible Output - JSON output with customizable formatting
- Well-Tested - Comprehensive test coverage with robust error handling
Installation
Command-Line Tool
Install via cargo:
This installs the ffcv binary for viewing Firefox configurations from your terminal.
Library Usage
Add to your Cargo.toml:
[]
= "1.0"
Command-Line Usage
List Firefox Profiles
# List all Firefox profiles on your system
# Specify a custom Firefox profiles directory
View Configuration
# View all preferences for the default profile
# Query specific preferences by glob pattern
# Get a single preference
# Read from stdin
|
# Output as JSON array
# Include human-readable explanations
# Read from a specific file
Library Usage
Basic Parsing
use parse_prefs;
use fs;
Query Preferences
use parse_prefs;
use QueryMatcher;
use fs;
Profile Discovery
use ProfileFinder;
Working with Preference Values
use ;
Preference Types
Firefox uses several types of preferences:
- User Preferences (
user_pref) - Set by the user - Default Preferences (
pref) - Application defaults - Locked Preferences (
lock_pref) - Administratively locked, cannot be changed - Sticky Preferences (
sticky_pref) - User preferences that persist across updates
Each preference has a value type:
- Boolean (
true/false) - Integer (64-bit)
- Float (64-bit)
- String (including JSON-encoded data)
- Null
Environment Variables
ffcv respects the following environment variables for Firefox profile discovery:
FIREFOX_BIN- Path to Firefox binaryMOZ_PROFILES_DIR- Custom Firefox profiles directoryPROGRAMFILES- Windows Program Files directory (for Firefox detection)HOME- User home directory (Unix-like systems)APPDATA- Application Data directory (Windows)
Documentation
Full API documentation is available on docs.rs.
To build and view the documentation locally:
Platform Support
ffcv is tested and supported on:
- Linux (x86_64, ARM64)
- macOS (x86_64, ARM64/Apple Silicon)
- Windows (x86_64)
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is dual-licensed under either:
- MIT License (LICENSE-MIT.txt or http://opensource.org/licenses/MIT)
- Apache License, Version 2.0 (LICENSE-APACHE-2.0.txt or http://www.apache.org/licenses/LICENSE-2.0)
You may choose either license for your use.
Acknowledgments
Built for the Rust community to make Firefox configuration management easier and more programmatic.
Inspired by the need for better tools to understand and manage Firefox's extensive preference system.