What operating system do you use?
All the remaining steps in this tutorial will require you to be running this mozilla-build environment.
If you run this script in your terminal, the packages required to build Firefox will be installed.
wget --no-check-certificate https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py && python bootstrap.py
If you prefer to set it up yourself, then follow the steps at our wiki.
Run hg clone https://hg.mozilla.org/mozilla-central
to get it. This is going to take a while.
Go to the new mozilla-central
directory, and run ./mach build
. This is going to take a very long time.
Run ./mach run -P blank
. If the profile manager dialog appears, create a new profile named blank
and continue starting Firefox.
Please visit #introduction on irc.mozilla.org and explain the problem you're having.
Choose a training mission:
The important thing to know about this mission is that Firefox's stylesheets are stored in browser/themes/
and toolkit/themes/
. The first path is for Firefox-specific theming, while the second is for theming shared by all Gecko-based applications (such as Thunderbird).
See if you can find the right stylesheet to change under browser/themes/
. There are different themes for each major platform (Windows, OS X, and Linux), so make sure you look in the correct subdirectory (ie. browser/themes/linux/
if you're using Linux).
It might be tempting to look at searchbar.css
, but that only styles the small input bar where you can quickly access major search enginges. You should look at browser.css
, which contains the styling rules for the majority of the Firefox user interface.
It turns out that browser.css
has a lot of rules in it. Let's narrow down the actual rule we want to change.
It's time to use Search Fox, the Mozilla Code Search tool. You can search for "browser.css" and take a look through the results; see if any of the files that show up look like good candidates!
You can focus on XUL and XML files, which are used to define Firefox's user interface. Often, CSS files share filenames with the files that they are styling - in this case, browser.xul
looks like a good match.
browser.xul
is a pretty big file, so it's usually best to search for keywords to find relevant parts. In this case, try searching for "tab" and see if you come across anything useful (such as a class or id attribute). If you do, see whether you can find the selector in browser.css
.
In your search, you should come across a <tabs>
element that represents the tabs in Firefox's interface. Everything you need can be found there, since it has a <tab>
child with a class attribute that is present in browser.css
.
Now that you have a selector to change in browser.css
, all that remains is to make your changes and rebuild Firefox. You can perform a full build (./mach build
), but in this case it is much faster to just rebuild browser/
, like so:
./mach build browser/
When this is finished, run the local Firefox build and see whether your changes worked!
Please visit #introduction on irc.mozilla.org and explain the problem you're having.
Created by Josh Matthews. Patches welcome on github.