Skip to content

Instantly share code, notes, and snippets.

@gsathya
Forked from paulrouget/ff.md
Created July 6, 2014 01:54
Show Gist options
  • Save gsathya/f0d48798a5de10e1c706 to your computer and use it in GitHub Desktop.
Save gsathya/f0d48798a5de10e1c706 to your computer and use it in GitHub Desktop.

More details here: https://developer.mozilla.org/en/docs/Simple_Firefox_build

Hacking Firefox

Get Firefox' source code:

git clone https://github.com/mozilla/gecko-dev.git
git checkout fx-team

Install dependencies:

./mach bootstrap
# doesn't work on Windows. See link above.

On osx (not needed for other platforms), create a mozconfig file in the source directory, with the following:

# adding .noindex will make sure spotlight
# won't index the objdir (slow).
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj.firefox.noindex

# Needed for osx 10.9 (fix a font issue):
ac_add_options --with-macos-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk

Run the following in the dir

./mach build

Wait a while...

./mach run -P dev

Firefox (frontend & devtools) code is located in:

browser/base/content
browser/themes
browser/devtools

Generate a patch:

In your ~/.gitconfig, add:

  [alias]
  hgp = "show --binary --format=\"# HG changeset patch%n# User %an <%ae>%n%B\" -U8"

Then:

git hgp HEAD > myFix.patch
# you can attach this patch to a bugzilla bug

Updated with changes? Run the following

./mach build browser
./mach run -P dev -jsconsole

Running tests for the entire suite

./mach mochitest-devtools browser/devtools

Running tests for a particular patch

./mach mochitest-devtools browser/devtools/path/to/the/test_you_want_to_run.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment