Building Mozilla web browser from source

This week I built the Firefox web browser from source. Mozilla currently has about 17,998,723 line of code, it is mostly built with C++ but also includes other languages such as HTML, C, JavaScript, Rust, and many more. I personally use Mozilla as my preferred browser, so it was interesting to download and modify the source code.

Mozilla has easy to read instructions that I followed for downloading the source code, building it, then running. I'm using Mozilla on a Windows 10 system.

Some of the prerequisites include installing Visual Studio with certain workloads, Rust, MAPI Header Files, and MozillaBuild. Once I installed everything necessary, I was ready to pull the Firefox source code using the command

hg clone https://hg.mozilla.org/mozilla-central
And then the wait begins.



After patiently waiting for the a while, the downloading aborts. Uh oh, what happened? The message read: "Rust compiler not found". I have installed the Rust compiler and have the PATH set in the Environment Variables, so what was the problem? I thought that maybe it's my laptops fault so I tried the same steps on my desktop, and same problem persisted on both of my machines. I knew that the fault was with my setup. Looking back through the instructions, I was suppose to add the line PATH=$PATH:~/.cargo/bin to one of the following ~/.bash_profile~/.bash_login, or ~/.profile. Aren't these Linux files, but I am on Windows, so how does this work? I thought that setting the Environment Variables was good enough. I tried searching these files on my computer but nothing came up. After running out of options, I tried the command  vi ~/.profile  and to my surprise, it worked!


I tried pulling the source code once again and this time everything worked! Once I built and ran the source, a new Firefox web browser window popped up. Success!


Now onto the fun part, modifying the code and seeing how I can change the browser window. I was surprised at the amount of files that the source contained, and with each file containing hundreds or thousands of lines of code.


I modified a few of the icons in the browser, the height of each tab, and the tabs toolbar background. As I was going through the code, I noticed the amount of comments used by these programmers. The comments were very clear and to the point, something I need to work on a little more.


My last change was to open up a cat gif site each time the user opens a new window. Although you could argue that the Firefox browser window that I modified isn't the prettiest, it was a fun experience building Firefox from source.



Comments

Popular posts from this blog

BTR820

DPS911 - Release 1

DPS911 - Release 3