Understanding the file structure
Lets take a look at the file structure of your project. It should look something like this:
Whilst this may seem large (especially if you look inside of the engine
) directory, it is all fairly manageable.
foxfork.json
The primary configuration file for your project is the foxfork.json
file. This is where you will put information about your browser so FoxFork can build it correctly. It should look something like this:
Up the top of the config file, we have general information about the browser you are building. This includes its name, the vendor creating it, its appId, and the name of the binary that will be output.
The version
key is used to specify information about the product you are building. product
is the Firefox branch you are building against. version
is the version of Firefox you are building against, which will vary with the branch. Here firefox
refers to the stable branch of Firefox.
buildOptions
provides a number of internal toggles for how FoxFork builds your project.
Configs
src/
The source folder contains all of the modifications that you have made to Firefox. These come in two types, inserted files (and folders) and patches. Both of these are applied using the FoxFork import
command.
Inserted files are just files (and folders) that you have inserted into the Firefox source code. These will overwrite existing files if they already exist. On Linux and MacOS, these are symlinked so when you change a file in src/
, the change will be mirrored in Firefox's source code instantly. On Windows, you will need to run FoxFork import
for these changes to apply.
Patches are changes to Firefox's files. As a rule of thumb, you should prefer splitting new content into a new file rather than using patches, but there are times when you must modify Firefox's source code. Each of these patch files are just git patch files:
In this patch, you can see that I am adding a *
to the start of a line. You generate these patches by modifying the file in the engine/
directory and running FoxFork export
to export your changes to the src directory. Be careful, if you do not export your changes, they will not be saved and will not work on other developers' computers or yours after an update!
engine/
The engine directory contains all of Firefox's source code. It is massive - around 15GB in size (around 11GB of that are build assets from when you run FoxFork build
). I am not able to provide a full explanation of the contents of the directory.
However, most of the changes you will want to make will be in engine/browser/
, which contains the source code for the browser's UI. Here are some of the important directories inside of the engine/browser/
directory:
Last updated