Welcome to Searchfox

Direct link to mozilla-central | mozilla-mobile | comm-central | nss | WHATWG HTML spec | mozilla-beta | mozilla-release | mozilla-esr60

Searchfox is a source code indexing tool for Mozilla Firefox. It indexes C++, Rust, and JavaScript code. This is the help page for Searchfox. You can contribute to Searchfox! Visit our Github page.

Query Language

Queries entered into the search box use exact string matching. No search operators are supported. Case insensitive matching and regular expression matching can be requested with the check boxes. Path filtering uses globbing. A path matches even if only a substring of the path is matched by the glob. Use the ^ and $ operators to match the beginning or end of the path. Here are some examples:
Find all paths containing the substring "test".
Find all paths starting with js/src.
Find all paths containing ".cpp".
Find all paths ending with ".cpp".
Find all C++ files in js/src, but not in subdirectories (i.e., * does not match /).
Find all C++ files in js/src or in subdirectories (i.e., ** matches /).
Find all C++ source or header files in js/src or in subdirectories.


Once you have arrived at a file, you can mouse over identifiers. If the color of the identifier changes, then clicking on the identifier will open a context menu for cross-referencing identifiers.

You can see an example by mousing over “reviveCrashedTab” and clicking. A context menu will open and you can choose to search for all references to the symbol (definitions, assignments, and uses).

In JavaScript code, a second option is sometimes offered. Try mousing over the same identifier in the following: “SessionStore.reviveCrashedTab”. In this case, you're given the opportunity to search for SessionStore.reviveCrashedTab (and not SessionStoreInternal.reviveCrashedTab). Also, since there is only one definition of SessionStore.reviveCrashedTab, you can jump directly to it.

In some cases there is ambiguity whether to search for C++ or JavaScript implementations of an XPCOM method. Searching for the method from C++ or JavaScript will find the same-language implementations of that method as well as the IDL declaration. Visiting the IDL declaration and searching from there will yield all implementations.

Syntax Highlighting

Searchfox uses semantic syntax highlighting. Types are shown in teal (blue-green). Definitions are shown in bold. Hovering over an identifier highlights other uses of that identifier.


Version 2.0 (May 31, 2016)

Version 1.5 (March 16, 2016)

Version 1.0 (January 10, 2016)

Bug reports

Please send bug reports to Bugzilla.