- Get the code
./bin/prepare-mochitests-dev
- Go to the firefox directory
cd firefox
- Build Firefox
./mach build
see docs - Run Firefox
./mach run
see docs
Firefox is a large project, but for the most part the relevant source code is in /devtools
. The debugger client, is in /devtools/client/debugger
.
You can update the debugger by running yarn watch
. The script will:
- copy the debugger files
- bundle dependencies into vendors
- bundle workers
Remember, every time the code changes in firefox you need to re-run
./mach build
!
Firefox has built the toolbox so that it is powerful enough to debug the Firefox. You can launch it with ./mach run --jsdebugger
. When you do, you're using the "browser toolbox" and you can inspect and debug anything in the browser, including the Debugger.
The server code lives in /devtools/server
. It can be a bit difficult to debug, so the best thing to do is to add log statements in the code with the special dump
command e.g. dump(">> I am here\n")
. When you do, you'll see the logs in the terminal and in the browser toolbox console.