how-to-build-firefox

Firefox Nightly

Open source is a dream and a gateway to an amazing career — I’m a testament to that. One of the most amazing open source projects to ever exist, Mozilla Firefox, is a project I’m proud to work on as an employee of Mozilla. It’s rewarding, challenging, and a unique experience…and I want you to join me!

Take a few moments with me to learn how to build the amazing Firefox!

Step 1: Clone Mozilla Central

Mozilla Central is the name of the mercurial repository that contains the source code of Firefox. Start by installing mercurial and cloning “MC”:

hg clone https://hg.mozilla.org/mozilla-central/

hg clone {repo_url} is the first and most basic mercurial command, but check out my Mercurial Productivity Tips post to learn more hg commands! “MC” will be installed in a mozilla-central directory.

Step 2: Install Dependencies

From C to Rust, Firefox has a fair bit of requirements you’ll need to install. From within the mozilla-central directory, run the following:

./mach bootstrap

The bootstrap command will install dependencies as well as configure mercurial extensions as required. Congratulations — you’re now ready to build!

Step 3: Create a mozconfig

You’ll thank me for this one! Create a mozconfig file to use artifact builds, which will save loads of time during the build process by downloading pre-built binaries for Firefox’s internals.

# Automatically download and use compiled C   components:
ac_add_options --enable-artifact-builds

# Write build artifacts to:
mk_add_options MOZ_OBJDIR=./objdir-frontend

Place the code above in your mozconfig file and you’re builds will be super fast!

Step 4: Build!

Once you have the code and the dependencies, it’s time to build the amazing Firefox! You can build Firefox with the following command:

./mach build

Hello Firefox!

Step 5: Run Firefox

Once you’ve built the amazing Firefox, you can run Firefox with the following mach command:

./mach run --jsdebugger

Congratulations! You’ve taken the Firefox source code and turned it into an application that you can run! The --jsdebugger option opens the “browser toolbox” which allows you to debug the Firefox you’ve just built.

Updating Mozilla Central Code

The Mozilla Central repository is updated several times a day as Mozilla employees and contributors like you submit patches. You can update your local checkout with the following:

hg pull && hg update --clean

You local commits will always be draft status while patches which have been merged into MC will be public status.

Configuring Options

Whenever Firefox developer and the community develop new features, they’re hidden behind a preference until the feature reaches maturity. To toggle feature flags, you can visit about:config in your local Firefox or any Firefox release.

about:config

The config page allows you to toggle and set a number of options. Many “edge” features debut behind feature flags in Firefox Nightly.

Congratulations! You’ve turned a massive repository of code into a living, breathing Firefox web browser! In the next post in the Firefox series, we’ll contribution and testing!

76 comments

  1. Thanks for a marvelous posting! I genuinely enjoyed reading it, you’re a great author.I will ensure that I bookmark your blog and will
    often come back sometime soon. I want to encourage that you
    continue your great job, have a nice day!

  2. We stumbled over here coming from a different web address and thought I may as well check things
    out. I like what I see so now i am following you. Look forward to
    looking at your web page again.

  3. I simply could not leave your site before suggesting that I really
    loved the standard info a person supply to your visitors?
    Is going to be back incessantly in order to check up on new posts

  4. Yesterday, while I was at work, my cousin stole my iPad and tested to see if it can survive
    a thirty foot drop, just so she can be a youtube sensation. My iPad
    is now broken and she has 83 views. I know this is
    entirely off topic but I had to share it with someone!

  5. It’s appropriate time to make some plans for the future and it’s time to be happy.
    I’ve read this post and if I could I want to suggest you few interesting things or tips.

    Maybe you can write next articles referring to this article.
    I desire to read even more things about it!

  6. I like what you guys are usually up too. This type of clever
    work and exposure! Keep up the awesome works guys I’ve included you guys to our blogroll.

  7. That is really fascinating, You are an overly professional blogger.
    I’ve joined your rss feed and stay up for in the hunt for more of your great post.
    Also, I’ve shared your website in my social networks

  8. I believe this is one of the such a lot important info for me.
    And i am happy studying your article. However want to remark on some common issues,
    The web site style is ideal, the articles is in reality nice : D.
    Excellent activity, cheers

  9. These are actually wonderful ideas in regarding blogging.
    You have touched some pleasant points here.
    Any way keep up wrinting.

  10. Hey there! This is my first visit to your blog! We are a collection of volunteers and starting a new
    initiative in a community in the same niche.
    Your blog provided us valuable information to work on. You have
    done a extraordinary job!

  11. Hello there! I know this is kinda off topic however ,
    I’d figured I’d ask. Would you be interested in exchanging links or maybe guest authoring a blog article or vice-versa?
    My blog addresses a lot of the same subjects as yours and I think we could greatly benefit from each other.
    If you happen to be interested feel free to shoot me an e-mail.
    I look forward to hearing from you! Terrific blog by the way!

  12. This is really interesting, You’re a very skilled blogger.
    I’ve joined your rss feed and look forward to
    seeking more of your fantastic post. Also, I’ve shared your
    web site in my social networks!

  13. I’m no longer sure where you are getting your info,
    but great topic. I must spend some time learning much more
    or figuring out more. Thanks for fantastic information I
    used to be in search of this info for my mission.

  14. I’ve been exploring for a bit for any high-quality articles or blog posts on this sort of house .
    Exploring in Yahoo I finally stumbled upon this web
    site. Reading this info So i am glad to express that I have a very excellent uncanny feeling I came
    upon exactly what I needed. I most definitely will make certain to
    do not omit this web site and give it a glance regularly.

  15. Spot on with this write-up, I absolutely believe that this web site
    needs a lot more attention. I’ll probably be returning to read more, thanks for the information!

  16. Incredible! This blog looks exactly like my old one! It’s
    on a completely different topic but it has pretty much the
    same layout and design. Outstanding choice of colors!

  17. Having read this I believed it was rather informative.
    I appreciate you taking the time and effort to put this informative article together.
    I once again find myself spending a lot of time both reading and leaving comments.
    But so what, it was still worthwhile!

  18. Magnificent beat ! I would like to apprentice
    at the same time as you amend your site, how can i subscribe for a blog web site?
    The account helped me a applicable deal. I have been a little bit familiar of this your broadcast provided brilliant clear concept

  19. Hey there, I think your website might be having browser compatibility issues.
    When I look at your website in Chrome, it looks fine but when opening in Internet Explorer, it
    has some overlapping. I just wanted to give you a quick heads up!
    Other then that, great blog!

  20. Thanks for the marvelous posting! I definitely enjoyed
    reading it, you will be a great author. I will always bookmark your blog and will eventually come back sometime
    soon. I want to encourage you to continue your great job, have a nice weekend!

  21. Hello There. I found your blog using msn. This is a really well written article.
    I’ll be sure to bookmark it and return to read more of your useful
    information. Thanks for the post. I’ll definitely comeback.

  22. Hello, i read your blog occasionally and i
    own a similar one and i was just curious if you get a lot of spam
    feedback? If so how do you protect against it, any plugin or anything you
    can suggest? I get so much lately it’s driving me insane so any assistance is very much appreciated.

  23. hello!,I really like your writing so a lot! percentage
    we keep in touch extra about your article on AOL? I need
    a specialist in this space to resolve my problem. Maybe that is you!
    Looking ahead to peer you.

  24. I have been exploring for a bit for any high-quality articles or blog posts in this kind of house .
    Exploring in Yahoo I at last stumbled upon this site.
    Reading this info So i’m glad to express that I
    have a very excellent uncanny feeling I discovered just what I needed.
    I so much certainly will make sure to do not disregard this site and give it a glance regularly.

  25. I was curious if you ever thought of changing the page
    layout of your site? Its very well written; I love what youve
    got to say. But maybe you could a little more in the way of content so people could
    connect with it better. Youve got an awful lot of text for only having 1 or 2 pictures.
    Maybe you could space it out better?

  26. Can I simply say what a relief to discover someone who genuinely understands what they’re discussing on the
    internet. You actually know how to bring an issue to light and
    make it important. More and more people have to check
    this out and understand this side of your story. I was surprised you are
    not more popular since you certainly possess the gift.

  27. I believe this is among the most significant info for me.
    And i am glad studying your article. However wanna observation on some normal things, The web
    site style is ideal, the articles is truly nice
    : D. Good process, cheers

  28. Hello! Do you know if they make any plugins to help with Search Engine Optimization? I’m trying
    to get my blog to rank for some targeted keywords but I’m not seeing very good gains.

    If you know of any please share. Thanks!

  29. Useful information. Fortunate me I found your site by accident, and I am shocked why this twist of fate
    did not happened earlier! I bookmarked it.

  30. Do you have a spam problem on this website; I also am a blogger, and I was wanting to know your
    situation; we have created some nice methods and we are looking
    to swap techniques with other folks, please shoot me an e-mail if interested.

  31. obviously like your web-site however you need to test
    the spelling on quite a few of your posts. Several of them are rife with spelling issues and
    I in finding it very bothersome to inform the truth on the
    other hand I’ll definitely come back again.

  32. Thank you, I’ve just been looking for information approximately
    this subject for ages and yours is the greatest I have found out so
    far. However, what about the bottom line? Are you certain in regards to the source?

  33. May I simply just say what a relief to uncover someone that actually understands what
    they’re talking about on the web. You actually know
    how to bring a problem to light and make it important.
    A lot more people ought to look at this and understand
    this side of the story. I was surprised that you aren’t more popular
    because you surely possess the gift.

  34. I’m gone to say to my little brother, that he should also go to see
    this web site on regular basis to obtain updated
    from most up-to-date news update.

  35. I’m truly enjoying the design and layout of your blog.
    It’s a very easy on the eyes which makes it much more pleasant for me to come here and visit more often. Did you hire out a designer to create your
    theme? Excellent work!

  36. What’s up to every single one, it’s truly a good for me to pay a visit this web site, it contains precious Information.

  37. continuously i used to read smaller articles or reviews that also clear their motive, and that is also happening
    with this piece of writing which I am reading now.

Leave a Reply

Your email address will not be published.