Welcome to Searchfox

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. Please send bug reports to Bugzilla.

Query Language

Searchfox supports both text and file path searches.

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:

test
Find all paths containing the substring "test".
^js/src
Find all paths starting with js/src.
*.cpp
Find all paths containing ".cpp".
*.cpp$
Find all paths ending with ".cpp".
^js/src/*.cpp$
Find all C++ files in js/src, but not in subdirectories (i.e., * does not match /).
^js/src/**.cpp$
Find all C++ files in js/src or in subdirectories (i.e., ** matches /).
^js/src/**.{cpp,h}$
Find all C++ source or header files in js/src or in subdirectories.

Repositories indexed

Repository Text search Blame Language semantic analysis
JS IDL C++ Rust
mozilla-central
mozilla-mobile
comm-central
wubkat (webkit index)
KaiOS
glean
nss
WHATWG HTML spec
TC39 ECMA262 spec
mozilla-build
mozilla-elm
mozilla-cedar
mozilla-beta
mozilla-release
mozilla-esr115
comm-esr115
mozilla-esr102
comm-esr102
mozilla-esr91
comm-esr91
mozilla-esr78
comm-esr78
mozilla-esr68
comm-esr68
mozilla-esr60
comm-esr60
mozilla-esr45
mozilla-esr31
mozilla-esr17
version-control-tools
l10n
LLVM
Graphviz
Rust
MinGW-w64
MinGW-w64 @revision used by m-c
mozilla-vpn-client

Cross-referencing

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.