### Setup Debian/Ubuntu Environment Source: https://github.com/librewolf/source/blob/main/_autodocs/QUICK-COMMANDS.md Installs necessary packages and configurations for building on Debian or Ubuntu systems. ```bash make setup-debian ``` -------------------------------- ### Setup Fedora/RHEL Environment Source: https://github.com/librewolf/source/blob/main/_autodocs/QUICK-COMMANDS.md Installs necessary packages and configurations for building on Fedora or RHEL-based systems. ```bash make setup-fedora ``` -------------------------------- ### Install Fedora/RHEL Dependencies Source: https://github.com/librewolf/source/blob/main/_autodocs/02-build-system.md Run `make setup-fedora` to install the required dependencies for building LibreWolf on Fedora or RHEL-based systems. ```bash dnf -y install python3 curl wget zstd python3-devel python3-pip \ mercurial openssl-devel libxml2-devel ``` -------------------------------- ### Build from Scratch Source: https://github.com/librewolf/source/blob/main/_autodocs/00-START-HERE.txt Commands to perform a one-time setup, download Firefox, extract and patch the source, compile, and package the binary. ```bash $ make bootstrap # One-time setup $ make fetch # Download Firefox $ make dir # Extract and patch $ make build # Compile $ make package # Create binary ``` -------------------------------- ### Install Debian/Ubuntu Dependencies Source: https://github.com/librewolf/source/blob/main/_autodocs/02-build-system.md Use `make setup-debian` to install the necessary dependencies for building LibreWolf on Debian or Ubuntu systems. ```bash apt-get -y install mercurial python3 python3-dev python3-pip \ curl wget dpkg-sig libssl-dev zstd libxml2-dev ``` -------------------------------- ### Setup Fedora/RHEL Build Agents Source: https://github.com/librewolf/source/blob/main/_autodocs/07-ci-cd-pipeline.md Installs necessary packages for Fedora/RHEL build agents using dnf. Includes Python, curl, wget, zstd, Mercurial, OpenSSL development libraries, and XML libraries. ```makefile setup-fedora : dnf -y install python3 curl wget zstd python3-devel python3-pip \ mercurial openssl-devel libxml2-devel ``` -------------------------------- ### Setup Debian/Ubuntu Build Agents Source: https://github.com/librewolf/source/blob/main/_autodocs/07-ci-cd-pipeline.md Installs necessary packages for Debian/Ubuntu build agents. Includes Mercurial, Python, curl, wget, dpkg-sig, OpenSSL development libraries, zstd, and XML libraries. ```makefile setup-debian : apt-get -y install mercurial python3 python3-dev python3-pip \ curl wget dpkg-sig libssl-dev zstd libxml2-dev ``` -------------------------------- ### Set Up Build Environment Source: https://github.com/librewolf/source/blob/main/_autodocs/02-build-system.md Run `make bootstrap` once to set up the build environment. This installs Python dependencies and calls Firefox's `mach bootstrap` command. ```makefile make bootstrap ``` -------------------------------- ### Search UI Documentation Source: https://github.com/librewolf/source/blob/main/_autodocs/00-START-HERE.txt Example of using grep to find documentation related to UI preferences within markdown files. ```bash grep -r "Preferences" *.md # Find UI docs ``` -------------------------------- ### Search Build Target Documentation Source: https://github.com/librewolf/source/blob/main/_autodocs/00-START-HERE.txt Example of using grep to find documentation related to a specific build target within markdown files. ```bash grep -r "make foo" *.md # Find build target docs ``` -------------------------------- ### Install WASM Sandbox Libraries (Linux) Source: https://github.com/librewolf/source/blob/main/_autodocs/02-build-system.md Use `make setup-wasi` on Linux to install the necessary WASM sandbox libraries required for building Firefox on that platform. ```makefile make setup-wasi ``` -------------------------------- ### Install mozconfig Source: https://github.com/librewolf/source/blob/main/_autodocs/05-build-scripts.md Copies the new mozconfig file into the source directory. ```bash cp -v ../assets/mozconfig.new mozconfig ``` -------------------------------- ### Example Patch List Source: https://github.com/librewolf/source/blob/main/_autodocs/04-configuration.md Lists patch files to be applied in order. Each line must be a relative path from the repository root, with no blank lines or comments. ```text patches/always-fetch-latest-toolchain-artifact.patch patches/autoconfig-setEnv.patch patches/bootstrap.patch patches/custom-ubo-assets-bootstrap-location.patch ``` -------------------------------- ### Unified Diff Format Example Source: https://github.com/librewolf/source/blob/main/_autodocs/08-patches-detailed.md An example illustrating the unified diff format used for patches, showing context lines and added lines. ```diff --- a/file.cpp +++ b/file.cpp @@ -10,6 +10,7 @@ existing line existing line existing line +new line added existing line existing line existing line ``` -------------------------------- ### Example mozconfig Generation Source: https://github.com/librewolf/source/blob/main/_autodocs/03-patch-system.md This is an example of a `mozconfig` file that is generated after patches are applied. It includes common compilation flags for building the browser. ```makefile # Compilation flags ac_add_options --enable-application=browser ac_add_options --disable-crashreporter ac_add_options --disable-telemetry # ... additional options (see 02-build-system.md) ``` -------------------------------- ### Search Patch Documentation Source: https://github.com/librewolf/source/blob/main/_autodocs/00-START-HERE.txt Example of using grep to find documentation related to LibreWolf patches within markdown files. ```bash grep -r "librewolf-patches" *.md # Find patch docs ``` -------------------------------- ### Fetch and Setup Firefox Nightly Source: https://github.com/librewolf/source/blob/main/_autodocs/05-build-scripts.md This script is designed for developers who need to quickly fetch and set up a Firefox Nightly environment for working on upstream Mozilla patches. ```bash #!/bin/bash # Example usage (actual script content not provided in source) # This is a placeholder to indicate the existence of the script. ``` -------------------------------- ### Re-run Bootstrap for Missing Dependencies Source: https://github.com/librewolf/source/blob/main/_autodocs/09-workflow-guide.md Use this command to re-run the bootstrap process when build fails due to missing dependencies. Platform-specific setup commands are also provided. ```bash # Re-run bootstrap make bootstrap # Or platform-specific setup: make setup-debian # Debian/Ubuntu make setup-fedora # Fedora/RHEL ``` -------------------------------- ### Find Instructions for Creating a New Patch Source: https://github.com/librewolf/source/blob/main/_autodocs/README.md Use cat and grep to locate instructions on creating a new patch within the workflow guide markdown file. ```bash # Need to create a patch? cat 09-workflow-guide.md | grep -A 20 "Creating a New Patch" ``` -------------------------------- ### Dependency Handling for Settings Source: https://github.com/librewolf/source/blob/main/_autodocs/04-configuration.md Demonstrates how to manage settings with dependencies using the 'deps' field in Preferences.addSetting. Custom get and set functions can access and modify dependent values. ```javascript Preferences.addSetting({ id: "librewolfExtensionUpdate", deps: ["librewolfExtensionUpdateEnabled", "librewolfExtensionAutoUpdateEnabled"], get: (_, deps) => deps.librewolfExtensionUpdateEnabled.value && deps.librewolfExtensionAutoUpdateEnabled.value, set: (value, deps) => { deps.librewolfExtensionUpdateEnabled.value = value; deps.librewolfExtensionAutoUpdateEnabled.value = value; } }); ``` -------------------------------- ### Get Version from File Function Source: https://github.com/librewolf/source/blob/main/_autodocs/05-build-scripts.md Retrieves the current version string from a specified file. It defaults to './version' and raises an error if the file contains multiple lines or is invalid. ```python def get_version_from_file(version_filename='./version') -> str: pass ``` -------------------------------- ### Build and Run Source: https://github.com/librewolf/source/blob/main/_autodocs/QUICK-COMMANDS.md Compiles the LibreWolf browser and then launches it. Assumes build dependencies are met. ```bash make build && make run ``` -------------------------------- ### Integrate Settings Repository Source: https://github.com/librewolf/source/blob/main/_autodocs/05-build-scripts.md Copies LibreWolf configuration files into the settings directory. ```bash mkdir -p lw cp ../../settings/librewolf.cfg lw/ cp ../../settings/distribution/policies.json lw/ cp ../../settings/defaults/pref/local-settings.js lw/ ``` -------------------------------- ### Display Mach Configure Help Source: https://github.com/librewolf/source/blob/main/docs/MachParameters.md Use this command to view all available configuration options for the Mach build system. Pipe the output to 'less' for easier navigation. ```sh ./mach configure -- --help | less ``` -------------------------------- ### Sign Builds with GPG Source: https://github.com/librewolf/source/blob/main/_autodocs/09-workflow-guide.md Set the SIGNING_KEY environment variable to your GPG key and then build the project to produce a signed archive. ```bash # Set SIGNING_KEY environment variable export SIGNING_KEY="$(cat ~/.gnupg/mykey.asc)" # Then build make all # Produces: librewolf-*.tar.gz.sig ``` -------------------------------- ### Manually Resolve Patch Conflicts Source: https://github.com/librewolf/source/blob/main/_autodocs/09-workflow-guide.md Guides through manually editing conflicted files and regenerating patches when automatic fixes fail. ```bash ./scripts/git-patchtree.sh patches/failing.patch ``` ```bash cd firefox-*/ ``` ```bash nano conflicted_file.cpp ``` ```bash git add conflicted_file.cpp git diff 4b825dc642cb6eb9a060e54bf8d69288fbee4904 HEAD > ../patches/failing.patch ``` ```bash cd .. ``` ```bash make check-patchfail ``` -------------------------------- ### Preferences.addSetting(object) Source: https://github.com/librewolf/source/blob/main/_autodocs/04-configuration.md Registers a UI control bound to one or more preferences. Allows custom logic for getting, setting, and disabling the control. ```APIDOC ## Preferences.addSetting(object) ### Description Registers a UI control bound to one or more preferences. Allows custom logic for getting, setting, and disabling the control. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **object** (object) - Required - An object representing the UI control setting. - **id** (string) - Required - UI control identifier. - **pref** (string) - Optional - Single preference binding. - **deps** (array) - Optional - Array of dependent setting IDs. - **get** (function) - Optional - Custom getter function that transforms the value. Signature: `get(value) → transformed value`. - **set** (function) - Optional - Custom setter function that transforms the value for storage. Signature: `set(value) → value for storage`. - **disabled** (function) - Optional - Function that returns true to disable the control. - **onUserChange** (function) - Optional - Callback function executed when the user changes the value. ### Request Example ```javascript Preferences.addSetting({ id: "librewolfSync", pref: "identity.fxaccounts.enabled", onUserChange() { // Handle user change } }); Preferences.addSetting({ id: "librewolfExtensionUpdate", deps: ["librewolfExtensionUpdateEnabled", "librewolfExtensionAutoUpdateEnabled"], get: (_, deps) => deps.librewolfExtensionUpdateEnabled.value && deps.librewolfExtensionAutoUpdateEnabled.value, set: (value, deps) => { deps.librewolfExtensionUpdateEnabled.value = value; deps.librewolfExtensionAutoUpdateEnabled.value = value; } }); ``` ### Response #### Success Response (200) No specific response documented. ``` -------------------------------- ### Build, Package, or Run from Repository Source: https://github.com/librewolf/source/blob/main/README.md Commands to build, package, or run LibreWolf after bootstrapping when building from the repository. Use `make package` to create a package or `make run` to execute the application directly. ```sh make build make package # OR make run ``` -------------------------------- ### Search Engine Configuration JSON Structure Source: https://github.com/librewolf/source/blob/main/_autodocs/04-configuration.md Example structure for search-config.json, defining search engine properties like ID, applicability, and modification timestamp. ```json { "data": [ { "schema": 1619432100208, "appliesTo": [ { "included": { "everywhere": true } } ], "webExtension": { "id": "ddg@search.mozilla.org" }, "id": "c0b26c0e-63e6-4235-b2ce-5f16b6a8bf87", "last_modified": 1654094046000 } // ... additional search engines ] } ``` -------------------------------- ### Command-line Usage for Test Targets Source: https://github.com/librewolf/source/blob/main/_autodocs/07-ci-cd-pipeline.md Illustrates how to invoke the defined test targets from the command line using make. ```bash make test # Full Linux test make test-macos # Test macOS build make test-windows # Test Windows build make test-candidate # Test against candidate channel make test-beta # Test against beta release ``` -------------------------------- ### Bootstrap System for Tarball Build Source: https://github.com/librewolf/source/blob/main/README.md Bootsstraps the system to prepare for building LibreWolf from a tarball. This command only needs to be run once. The `--application-choice=browser` flag specifies the application to build. ```sh ./mach --no-interactive bootstrap --application-choice=browser ``` -------------------------------- ### Initialize Git for Patch Development Source: https://github.com/librewolf/source/blob/main/_autodocs/05-build-scripts.md Extracts Firefox source and sets up a Git repository for patch development. Requires 'version' file and Firefox source tarball. ```bash ./scripts/git-patchtree.sh ``` -------------------------------- ### Check Version and Build Source: https://github.com/librewolf/source/blob/main/_autodocs/QUICK-COMMANDS.md Verifies the current version and performs a full build of the browser. ```bash make check && make all ``` -------------------------------- ### Clone LibreWolf Repository Source: https://github.com/librewolf/source/blob/main/README.md Clones the LibreWolf source repository recursively and navigates into the cloned directory. Ensure you have Git installed and the `--recursive` flag is used to fetch submodules. ```sh git clone --recursive https://codeberg.org/librewolf/source.git librewolf-source cd librewolf-source ``` -------------------------------- ### Mach Configure Usage Overview Source: https://github.com/librewolf/source/blob/main/docs/MachParameters.md This is a general overview of the 'configure.py' script's usage and available options. It categorizes options for easier understanding. ```sh Usage: configure.py [options] Options: [defaults in brackets after descriptions] Help options: --help print this message Options from ../build/moz.configure/init.configure: --enable-application Application to build. Same as --enable-project. --enable-project Project to build [browser] --enable-artifact-builds Download and use prebuilt binary artifacts. --host Define the system type performing the build --target Define the system type where the resulting executables will be used --with-version-file-path Specify a custom path to app version files instead of auto-detecting --as-milestone={early-beta,late-beta,release} Build with another milestone configuration (e.g., as release) --enable-update-channel Select application update channel [default] --with-app-basename Typically stays consistent for multiple branded versions of a given application (e.g. Aurora and Firefox both use "Firefox"), but may vary for full rebrandings (e.g. Iceweasel). Used for application.ini's "Name" field, which controls profile location in the absence of a "Profile" field (see below), and various system integration hooks (Unix remoting, Windows MessageWindow name, etc. Options from ../moz.configure: --enable-artifact-build-symbols={full} Download symbols when artifact builds are enabled. --disable-compile-environment Disable compiler/library checks --disable-tests Do not build test libraries & programs --enable-debug Enable building with developer debug info. --with-debug-label Debug DEBUG_ for each comma-separated value given --disable-release Do not build with more conservative, release engineering-orient --disable-unified-build Enable building modules in non unified context --enable-valgrind Enable Valgrind integration hooks --enable-build-backend={Clangd,ChromeMap,CompileDB,CppEclipse,FasterMake,FasterMake+Recur,RecursiveMake,StaticAnalysis,TestManifest,VisualStudio} Deprecated --build-backends={Clangd,ChromeMap,CompileDB,CppEclipse,FasterMake,FasterMake+RecursiveMasiveMake,StaticAnalysis,TestManifest,VisualStudio} Build backends to generate [RecursiveMake,FasterMake,Clangd] --enable-gtest-in-build Enable building the gtest libxul during the build. --enable-ui-locale Select the user interface locale (default: en-US) [en-US] --disable-icu4x Disable using ICU4X --enable-dtrace Build with dtrace support --disable-icf Disable Identical Code Folding --enable-strip Enable stripping of libs & executables --disable-install-strip Enable stripping of libs & executables when packaging --with-system-zlib Use system libz Options from ../build/moz.configure/bootstrap.configure: --enable-bootstrap Automatically bootstrap or update some toolchains Options from ../build/moz.configure/toolchain.configure: --disable-optimize Disable optimizations via compiler flags --with-toolchain-prefix Prefix for the target toolchain --with-compiler-wrapper Enable compiling with wrappers such as distcc and ccache --with-ccache Enable compiling with ccache --enable-gold Deprecated --enable-linker Select the linker {bfd, gold, ld64, lld, lld-*, mold} --disable-debug-symbols Disable debug symbols using the given compiler flags --enable-address-sanitizer Enable Address Sanitizer --enable-memory-sanitizer Enable Memory Sanitizer --enable-thread-sanitizer Enable Thread Sanitizer --enable-undefined-sanitizer Enable UndefinedBehavior Sanitizer --enable-signed-overflow-sanitizer Enable UndefinedBehavior Sanitizer (Signed Integer Overflow Par --enable-unsigned-overflow-sanitizer Enable UndefinedBehavior Sanitizer (Unsigned Integer Overflow P --enable-hardening Enables security hardening compiler options --enable-frame-pointers Enable frame pointers --enable-coverage Enable code coverage --enable-clang-plugin Enable building with the Clang plugin (gecko specific static an ``` -------------------------------- ### Open User's Firefox Profile Directory Source: https://github.com/librewolf/source/blob/main/_autodocs/06-ui-customization.md Opens the user's Firefox profile directory in the system's file manager. Uses browser services to get the profile path and reveal it. ```javascript function openProfileDirectory() { let currProfD = Services.dirsvc.get("ProfD", Ci.nsIFile); let profileDir = currProfD.path; let nsLocalFile = Components.Constructor( "@mozilla.org/file/local;1", "nsIFile", "initWithPath" ); new nsLocalFile(profileDir).reveal(); } ``` -------------------------------- ### Return to Repository Root Source: https://github.com/librewolf/source/blob/main/_autodocs/09-workflow-guide.md Navigates back to the main LibreWolf source directory. ```bash cd .. ``` -------------------------------- ### Create Distributable Binaries Source: https://github.com/librewolf/source/blob/main/_autodocs/02-build-system.md Use `make package` to create distributable binaries for LibreWolf. This command invokes `./mach package-multi-locale` to produce localized tarball archives. ```makefile make package ``` -------------------------------- ### Test Build Source: https://github.com/librewolf/source/blob/main/_autodocs/00-START-HERE.txt Command to run a full integration test on the built project. ```bash $ make test # Full integration test ``` -------------------------------- ### Build Docker Image Source: https://github.com/librewolf/source/blob/main/_autodocs/07-ci-cd-pipeline.md Builds the Docker image containing the LibreWolf build environment. Use `--no-cache` to ensure a clean build. ```makefile docker-build-image : docker build --no-cache -t librewolf-build-image - < assets/Dockerfile ``` -------------------------------- ### Common LibreWolf Build Commands Source: https://github.com/librewolf/source/blob/main/_autodocs/00-index.md A collection of essential commands for setting up, building, maintaining, testing, and managing LibreWolf builds. These commands cover the entire build lifecycle. ```bash # Setup make bootstrap # One-time setup make fetch # Download Firefox make dir # Extract and patch # Building make build # Compile make package # Create binary make run # Execute # Maintenance make check # Check for Firefox updates make check-patchfail # Validate patches make clean # Remove artifacts make distclean # Remove everything # Testing make test # Full integration test make test-linux # Linux test make test-macos # macOS test make test-windows # Windows test # Docker make docker-build-image # Build container make docker-run-build-job # Execute in container ``` -------------------------------- ### Maintain Separate Firefox and LibreWolf Directories Source: https://github.com/librewolf/source/blob/main/_autodocs/QUICK-COMMANDS.md Instructions for setting up separate directories to keep both Firefox and LibreWolf source trees distinct during development. ```bash # Use separate directories make dir mv librewolf-* librewolf-src # ...continue building elsewhere... ``` -------------------------------- ### Test Against Beta Release Source: https://github.com/librewolf/source/blob/main/_autodocs/02-build-system.md Execute `make test-beta` to test against a beta release of LibreWolf. This sets the `FF_CHANNEL` environment variable to `beta`. ```makefile make test-beta ``` -------------------------------- ### Optimize Build Performance Source: https://github.com/librewolf/source/blob/main/_autodocs/09-workflow-guide.md Tips for faster rebuilds by caching the Firefox tarball. Subsequent builds can reuse the cached tarball and perform quick re-patches and rebuilds. ```bash # First build downloads and caches make fetch # Downloads once make dir # Uses cached tarball make build # Compiles # Subsequent builds reuse tarball make clean # Only removes built objects make dir # Quick re-patch make build # Quick rebuild ``` -------------------------------- ### Build Complete LibreWolf Source Tarball Source: https://github.com/librewolf/source/blob/main/_autodocs/02-build-system.md Use `make all` to build the complete LibreWolf source tarball. This process includes fetching, extracting, patching, and packaging the source code, and produces checksums and an optional GPG signature. ```makefile make all ``` -------------------------------- ### LibreWolf Build Overview Diagram Source: https://github.com/librewolf/source/blob/main/README.md A Mermaid diagram illustrating the LibreWolf build process and its relationship with the Firefox source, settings, and various distribution channels. ```mermaid graph LR FFSRC(Firefox Source) FFSRC--Tarball--->Source subgraph LibreWolf/ Settings(Settings)--"librewolf.cfg
policies.json"-->Source Website(Website

- Documentation
- FAQ) subgraph Browser/ Source(Source

- Patches
- Theming
- Build scripts) bsys6(bsys6

New Docker building
repository) AppImage ArchGentoo["Arch / Gentoo"] end end Website-->librewolf.net Source--"Source tarball"-->bsys6 AppImage--".appimage"-->librewolf.net bsys6--"Windows setup.exe"--->librewolf.net bsys6--"Windows portable.zip"--->librewolf.net bsys6--"Windows .msix"--->MS("Microsoft Store") bsys6--"Windows .nupkg"--->Chocolatey bsys6--"Linux binary tarball"--->Flathub bsys6--"Linux binary tarball"--> AppImage bsys6--"Linux .deb"--->repo.librewolf.net bsys6--"Linux .rpm"--->repo.librewolf.net bsys6--"Linux binary tarball
for 'librewolf-bin'"--> ArchGentoo Source--"Source tarball
for 'librewolf'"-->ArchGentoo ArchGentoo-->AUR_Overlay["AUR / Overlay"] ``` -------------------------------- ### Full Local Test Workflow Source: https://github.com/librewolf/source/blob/main/_autodocs/QUICK-COMMANDS.md Performs a complete local build and test cycle, including cleaning previous builds, fetching sources, and packaging. ```bash make distclean && make fetch && make dir && make build && make package ``` -------------------------------- ### Clean and Rebuild Project Source: https://github.com/librewolf/source/blob/main/_autodocs/QUICK-COMMANDS.md Execute this sequence to clean previous build artifacts and attempt a fresh build, useful after build failures. ```bash # Clean and try again make clean make build ``` -------------------------------- ### Configure Branding and Localization in mozconfig Source: https://github.com/librewolf/source/blob/main/_autodocs/04-configuration.md Set the application name, branding assets directory, and localization file location for LibreWolf. ```makefile ac_add_options --with-app-name=librewolf ac_add_options --with-branding=browser/branding/librewolf ac_add_options --with-l10n-base=$PWD/lw/l10n ``` -------------------------------- ### Build, Package, or Run from Tarball Source: https://github.com/librewolf/source/blob/main/README.md Commands to build, package, or run LibreWolf after bootstrapping when building from a tarball. Use `./mach package` to create a package or `./mach run` to execute the application directly. ```sh ./mach build ./mach package # OR ./mach run ``` -------------------------------- ### Test Linux Build Source: https://github.com/librewolf/source/blob/main/_autodocs/02-build-system.md Use `make test-linux` to specifically test the Linux build of LibreWolf. ```makefile make test-linux ``` -------------------------------- ### Build, Run, and Remove Docker Image Source: https://github.com/librewolf/source/blob/main/_autodocs/04-configuration.md Commands to manage the Docker container used for building the project. Use 'make docker-build-image' to build the container, 'make docker-run-build-job' to execute a build, and 'make docker-remove-image' to clean up. ```bash make docker-build-image # Build container make docker-run-build-job # Execute build job make docker-remove-image # Clean up ``` -------------------------------- ### Complete Integration Test Source: https://github.com/librewolf/source/blob/main/_autodocs/02-build-system.md Run `make full-test` for a complete integration test. This target builds the source tarball and delegates the actual build testing to `bsys6` for Linux x86_64 `.xz` artifacts. ```makefile make full-test ``` -------------------------------- ### Search Build Targets in Markdown Files Source: https://github.com/librewolf/source/blob/main/_autodocs/README.md Use grep to quickly find information about specific build targets within the documentation's markdown files. ```bash # Need to understand a build target? grep -r "make foo" *.md ``` -------------------------------- ### openAboutConfig() Source: https://github.com/librewolf/source/blob/main/_autodocs/04-configuration.md Opens the 'about:config' preferences editor in a new tab or window. ```APIDOC ## openAboutConfig() ### Description Opens the 'about:config' preferences editor in a new tab or window. ### Parameters None ### Request Example ```javascript openAboutConfig(); ``` ### Response #### Success Response (200) No specific response documented. ``` -------------------------------- ### Create Docker Build Container Image Source: https://github.com/librewolf/source/blob/main/_autodocs/02-build-system.md Use `make docker-build-image` to create a Docker image named `librewolf-build-image` using the provided Dockerfile. This builds the image from scratch without using the cache. ```makefile make docker-build-image ``` -------------------------------- ### View and Set Project Version Source: https://github.com/librewolf/source/blob/main/_autodocs/QUICK-COMMANDS.md Commands to check the current project version and manually set it by updating version files. ```bash # View current version cat version cat release # Manually set version echo "129.0" > version echo "1" > release ``` -------------------------------- ### Test Patches Quickly Source: https://github.com/librewolf/source/blob/main/_autodocs/QUICK-COMMANDS.md Compare the time taken for 'make check-patchfail' (approx. 5 minutes) versus 'make test' (approx. 2+ hours) for efficient patch testing. ```bash # Test patch without building make check-patchfail # 5 minutes # vs make test # 2+ hours ``` -------------------------------- ### Test an Existing Patch Source: https://github.com/librewolf/source/blob/main/_autodocs/03-patch-system.md Demonstrates how to test an existing patch using the `git-patchtree.sh` script and verify its application within the extracted source code. It also shows how to use `make check-patchfail` for verification. ```bash # Using git-patchtree.sh to work on existing patch ./scripts/git-patchtree.sh patches/path/to/patch.patch # Navigate to extracted source cd firefox- # Make changes while under git control # (files are automatically added when script runs) # Verify patch applies cleanly make check-patchfail ``` -------------------------------- ### Download Firefox Source Tarball Source: https://github.com/librewolf/source/blob/main/_autodocs/02-build-system.md Use `make fetch` to download the Firefox source tarball and its GPG signature. The signature is verified against the Mozilla public key. ```makefile make fetch ``` -------------------------------- ### Key Files in LibreWolf Build Source: https://github.com/librewolf/source/blob/main/_autodocs/00-index.md Highlights essential files within the LibreWolf project and their primary functions. These files are critical for understanding build orchestration, versioning, and configuration. ```text File | Purpose ------|--------- `Makefile` | Build orchestration (30+ targets) `version` | Firefox base version `release` | LibreWolf release counter `assets/mozconfig.new` | Compilation flags `assets/patches.txt` | Ordered patch list `assets/search-config.json` | Search engine config `scripts/librewolf-patches.py` | Patch application (850 lines) `patches/pref-pane/librewolf.js` | Preferences panel API ``` -------------------------------- ### Test Windows ZIP Build Source: https://github.com/librewolf/source/blob/main/_autodocs/02-build-system.md Run `make test-windows` to test the Windows ZIP build of LibreWolf. ```makefile make test-windows ``` -------------------------------- ### Clone and Build Firefox with mozilla-unified Source: https://github.com/librewolf/source/blob/main/README.md This sequence clones the mozilla-unified repository, updates it, and then bootstraps and builds the Firefox application. This is necessary for creating patches compatible with Mozilla's Nightly builds. ```sh hg clone https://hg.mozilla.org/mozilla-unified cd mozilla-unified hg update MOZBUILD_STATE_PATH=$HOME/.mozbuild ./mach --no-interactive bootstrap --application-choice=browser ./mach build ./mach run ``` -------------------------------- ### Compile LibreWolf Source: https://github.com/librewolf/source/blob/main/_autodocs/02-build-system.md Execute `make build` after running `make bootstrap` to compile LibreWolf. This command runs `./mach build` in the patched source directory. ```makefile make build ``` -------------------------------- ### Create a Patch from Local Changes Source: https://github.com/librewolf/source/blob/main/README.md Use this command sequence to initialize a git repository, stage changes, commit them, and generate a patch file from your local modifications within the LibreWolf source directory. ```sh cd librewolf-$(cat version) git init git add git commit -am initial-commit git diff > ../mypatch.patch ``` -------------------------------- ### Re-bootstrap Build Environment Source: https://github.com/librewolf/source/blob/main/_autodocs/QUICK-COMMANDS.md Use this command to reset and re-bootstrap the build environment when facing build failures. ```bash # Re-bootstrap make bootstrap ``` -------------------------------- ### Test Against Candidate Release Source: https://github.com/librewolf/source/blob/main/_autodocs/02-build-system.md Use `make test-candidate` to test against a candidate release of LibreWolf. This sets the `FF_CHANNEL` environment variable to `candidates`. ```makefile make test-candidate ``` -------------------------------- ### Clone LibreWolf Repository Source: https://github.com/librewolf/source/blob/main/_autodocs/QUICK-COMMANDS.md Use this command to clone the LibreWolf source code repository and initialize submodules. ```bash git clone --recursive https://codeberg.org/librewolf/source.git cd librewolf-source ``` -------------------------------- ### Faster Incremental Builds Source: https://github.com/librewolf/source/blob/main/_autodocs/QUICK-COMMANDS.md Optimize build times by avoiding re-downloading the Firefox tarball. Use 'make clean' to remove only build artifacts, then 'make build' for a quick rebuild. ```bash # Avoid re-downloading Firefox make clean # Only removes build artifacts make build # Quick rebuild with cached tarball ``` -------------------------------- ### Apply Main Patches Source: https://github.com/librewolf/source/blob/main/_autodocs/05-build-scripts.md Applies main patches sequentially from a specified patch file. ```bash patch -p1 -i ../patches/... ``` -------------------------------- ### Execute LibreWolf Directly Source: https://github.com/librewolf/source/blob/main/_autodocs/02-build-system.md Run `make run` after `make build` has completed to execute LibreWolf directly from the source directory using `./mach run`. ```makefile make run ``` -------------------------------- ### Execute Patch Script Source: https://github.com/librewolf/source/blob/main/_autodocs/03-patch-system.md Command to run the patch application script. Replace `` and `` with the appropriate values. ```bash python3 scripts/librewolf-patches.py ``` -------------------------------- ### List Build Targets Source: https://github.com/librewolf/source/blob/main/_autodocs/QUICK-COMMANDS.md Extracts and lists all available build targets defined in the Makefile. ```bash grep "^[a-z][a-z-]*:" Makefile | awk '{print $1}' | sed 's/://' ``` -------------------------------- ### Build and manage Docker images and jobs Source: https://github.com/librewolf/source/blob/main/_autodocs/09-workflow-guide.md Commands to build the Docker container image, run a build job within it, list artifacts, and clean up the image. Artifacts are placed in the current directory. ```bash # Build container image make docker-build-image # Run build job make docker-run-build-job # Artifacts appear in current directory ls -lh *.xz # Clean up make docker-remove-image ``` -------------------------------- ### initSettingGroup(id) Source: https://github.com/librewolf/source/blob/main/_autodocs/04-configuration.md Initializes all settings within a specified group. This function is called during the initialization of the preferences panel. ```APIDOC ## initSettingGroup(id) ### Description Initializes all settings within a specified group. This function is called during the initialization of the preferences panel. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```javascript initSettingGroup("librewolfBehavior"); initSettingGroup("librewolfNetworking"); initSettingGroup("librewolfPrivacy"); initSettingGroup("librewolfFingerprinting"); ``` ### Response #### Success Response (200) No specific response documented. ``` -------------------------------- ### Perform Incremental Builds Source: https://github.com/librewolf/source/blob/main/_autodocs/09-workflow-guide.md After making code changes in the source directory, use these commands for incremental compilation and testing. Update the patch afterwards. ```bash # After code changes in source directory: cd librewolf-*/ ./mach build # Incremental compilation ./mach run # Test directly # Then update patch: cd .. ./scripts/git-patchtree.sh patches/your.patch ``` -------------------------------- ### Set Search Configuration Source: https://github.com/librewolf/source/blob/main/_autodocs/05-build-scripts.md Copies the search configuration JSON file to its destination in the source tree. ```bash cp -v ../assets/search-config.json \ services/settings/dumps/main/search-config.json ``` -------------------------------- ### Manually Update Version Source: https://github.com/librewolf/source/blob/main/_autodocs/09-workflow-guide.md Set a specific Firefox version and LibreWolf release number, then rebuild the project. ```bash # Update to specific version echo "129.0" > version echo "1" > release # Then build make all ``` -------------------------------- ### Environment Variables for Building Source: https://github.com/librewolf/source/blob/main/_autodocs/QUICK-COMMANDS.md Set these environment variables to customize the build process, such as specifying the Firefox channel or signing releases. ```bash # Custom Firefox channel export FF_CHANNEL=beta export FF_BUILD=build1 make fetch ``` ```bash # Sign release with GPG export SIGNING_KEY="$(cat ~/.gnupg/key.asc)" make all ``` ```bash # Build directory caching export MOZBUILD_STATE_PATH=$HOME/.mozbuild make bootstrap ``` -------------------------------- ### Extract Tarball and Navigate Source: https://github.com/librewolf/source/blob/main/README.md Extracts the downloaded LibreWolf source tarball and navigates into the extracted directory. Replace `` with the actual tarball filename and `` with the extracted directory name. ```sh tar xf cd ``` -------------------------------- ### Quick Patch Test Source: https://github.com/librewolf/source/blob/main/_autodocs/QUICK-COMMANDS.md Runs a quick test to check if patches can be applied without failures. Exits with success if all patches are applied. ```bash make check-patchfail && echo "✓ All patches OK" ``` -------------------------------- ### File Locations for LibreWolf Source Source: https://github.com/librewolf/source/blob/main/_autodocs/QUICK-COMMANDS.md These are the standard file and directory locations for the LibreWolf source code, patches, and build artifacts. ```bash # Firefox tarball ./firefox-$(cat version).source.tar.xz ``` ```bash # Patched source ./librewolf-$(cat version)-$(cat release)/ ``` ```bash # Build output ./librewolf-*/obj-*/dist/ ``` ```bash # Compiled binary ./librewolf-*/obj-*/dist/librewolf ``` ```bash # Checksums ./librewolf-*.tar.*.sha256sum ./librewolf-*.tar.*.sha512sum ``` -------------------------------- ### Run Build Job in Docker Source: https://github.com/librewolf/source/blob/main/_autodocs/07-ci-cd-pipeline.md Executes the LibreWolf build process inside a Docker container. Mounts the current directory to `/output` for artifacts and removes the container after completion. Ensure the `build_image` variable is set. ```makefile docker-run-build-job : docker run -v $$(pwd):/output --rm $(build_image) \ sh -c "git pull && make fetch && make build package && cp -v ./*.xz /output" ``` -------------------------------- ### Apply Pref-Pane Patches and Assets Source: https://github.com/librewolf/source/blob/main/_autodocs/05-build-scripts.md Applies pref-pane patches and copies associated assets if not skipped. ```bash patches/pref-pane/pref-pane-small.patch ``` ```bash category-librewolf.svg ``` ```bash librewolf.css ``` ```bash librewolf.inc.xhtml ``` ```bash librewolf.js ``` -------------------------------- ### Apply LibreWolf Localization Source: https://github.com/librewolf/source/blob/main/_autodocs/05-build-scripts.md Merges LibreWolf localization data into Firefox locale files. ```bash ../l10n/ directory ``` ```bash locales/en-US/ ``` ```bash lw/l10n/ ``` -------------------------------- ### Test macOS DMG Build Source: https://github.com/librewolf/source/blob/main/_autodocs/02-build-system.md Execute `make test-macos` to test the macOS DMG build of LibreWolf. ```makefile make test-macos ``` -------------------------------- ### Fetch Firefox Source and Apply a Patch Source: https://github.com/librewolf/source/blob/main/README.md This snippet shows how to fetch the Firefox tarball using 'make fetch' and then apply a specific patch file to the source tree using a git-patchtree script. ```sh make fetch ./scripts/git-patchtree.sh patches/sed-patches/disable-pocket.patch ``` -------------------------------- ### Create a New Patch Source: https://github.com/librewolf/source/blob/main/_autodocs/03-patch-system.md This snippet outlines the process for creating a new patch file from changes made to the source code. It involves initializing a git repository, committing changes, and generating a diff against the root commit. ```bash cd librewolf-$(cat version) git init git add git commit -am initial-commit # Make changes to files... git add git commit -am patch-commit git diff 4b825dc642cb6eb9a060e54bf8d69288fbee4904 HEAD > ../mypatch.patch ```