Building Firefox nightly
The Mozilla’s documentation about compiling Firefox is pretty straightforward. On Windows, you basically need just
- Build prerequisities which mostly means some Visual Studio edition + MozillaBuild package.
- Second step is just to go to extracted MozillaBuild package folder and start apropriate command prompt (bash + some paths).
- In this new command window, get sources using hg (Mercurial client, which is part of MozillaBuild package & paths).
- start the build in using:
- Start the built Firefox, using
Set to some folder where you would like to deploy Firefox sources and start hg. The command is:
Using Firefox nightly from Visual Studio
Now you should have Firefox running, built by the Mozilla scripts. There is no way how to build everything in Visual Studio, but you can open the browser in that and debug it. Its limited to just browser itself and some internal libraries are not included, for example NSS (library serving the work with HTTPS). To generate the Visual Studio project you need to return to your MozillaBuild prompt, (you should sill be in your mozilla sources folder) and enter:
./mach build-backend -b VisualStudio
after this command, you will get a .sln file generated in your Firefox sources folder under
You can open this in Visual Studio (2013 in my case) without a problem.
Enable logging of LOG messages
When you will be looking at code you will find, that there is a pretty amount of log messages being logged using LOG or LOG3 macros. These are actually logging if you enable logging for your module. If you want to log everything, just set these Windows variables before starting new firefox.exe:
Then the log file is generated under %TEMP%\fflog.txt. To open just use
Debugging Firefox in Visual Studio
Its actually not a big deal, just attach your Visual Studio to running firefox.exe and set a breakpoint and you are good to go.