Firefox Source Docs Logo

Quick search

Overview

  • A Glossary of Common Terms
  • A Quick Guide to Mozilla Applications

Getting Started

  • Getting Set Up To Work On The Firefox Codebase

Working On Firefox

  • Working on Firefox
    • Firefox Contributors’ Quick Reference
    • Working with stack of patches Quick Reference
    • Making a patch series reviewable
    • Phabricator vs GitHub
    • Pocket Guide: Shipping Firefox
    • Editor / IDE integration
    • Getting reviews
    • Levelling up
    • How to submit a patch
    • Data Collection
    • Data Review
    • Searchfox
      • Searchfox Query Language Documentation
        • Basic Search
        • Query Parameters
        • Advanced Query Syntax
        • Sharing and Collaboration
      • Source listing
      • Context Menu
      • Navigation Panel
      • Blame
      • Diagramming
      • Class field layout
      • Backend
      • Repositories
      • Get Involved
    • Firefox AI Coding Policy
    • Introduction to Jujutsu
    • Git Tricks
    • Code Review FAQ
    • Reviewer Checklist
    • Debugging Firefox
    • Configure Development Certificate
    • Signing Local macOS Builds
    • Firefox Source Code Directory Structure
    • Understanding Artifact Builds
    • Firefox for Mobile Devices
    • Working with ESR115
    • Engineering Show and Tell
    • Filing good bugs
    • Helpful error messages for web developers
  • Bug Handling
  • Firefox Crash Reporting

Firefox User Guide

  • 3D view
  • about:debugging
  • Accessibility Inspector
  • Application
  • Browser Console
  • Browser Toolbox
  • Custom Formatters
  • The Firefox JavaScript Debugger
  • Debugger-API
  • Deprecated tools
  • DevTools API
  • DevToolsColors
  • DOM Property Viewer
  • Eyedropper
  • Index
  • JavaScript Tracer
  • JSON viewer
  • All keyboard shortcuts
  • Local Mode
  • Measure a portion of the page
  • Memory
  • Migrating from Firebug
  • Network Monitor
  • Page Inspector
  • Performance Tool
  • Responsive Design Mode
  • Rulers
  • Settings
  • Shader Editor
  • Storage Inspector
  • Style Editor
  • Taking screenshots
  • Tips
  • Toolbox
  • Validators
  • View Source
  • Web Audio Editor
  • Web Console
  • Working with iframes
  • Firefox DevTools User Docs

Source Code Documentation

  • Governance
  • Firefox Front-end
  • DOM
  • Editor
  • Style system (CSS) & Layout
  • Graphics
  • Processes, Threads and IPC
  • Getting started
  • Architecture overview
  • Contributing
  • Bugs and issues
  • Firefox DevTools Contributor Docs
  • Toolkit
  • SpiderMonkey
  • JS Loader
  • GeckoView
  • Fenix
  • Focus for Android
  • WebIDL
  • libpref
  • Networking
  • Remote Protocols
  • Services
  • Permissions
  • File Handling
  • Widget
  • Firefox on macOS
  • Firefox on Windows
  • Firefox AI Runtime
  • Page Extractor
  • Accessibility
  • Media Playback
  • Code quality
  • Writing Rust Code
  • Rust Components
  • Gecko Profiler
  • Performance
  • Database bindings (SQLite, KV, …)
  • XPCOM
  • NSPR
  • Network Security Services (NSS)
  • Web Security Checks in Gecko
  • RLBox sandboxing

The Firefox Build System

  • Mach
  • Pushing to Try
  • Build System
  • Firefox CI and Taskgraph
  • Managing Documentation
  • Vendoring Third Party Components

Testing & Test Infrastructure

  • Automated Testing
  • Understanding Treeherder Results
  • Sheriffed intermittent failures
  • Turning on Firefox tests for a new configuration
  • Avoiding intermittent tests
  • Debugging Intermittent Test Failures
  • Testing Policy
  • Configuration Changes
  • Browser chrome mochitests
  • Chrome Tests
  • geckodriver
  • Test Verification
  • WebRender Tests
  • Mochitest
  • XPCShell tests
  • TPS
  • web-platform-tests
  • GTest
  • Fuzzing
  • Sanitizer
  • Performance Testing
  • Code coverage
  • Testing & Debugging Rust Code

AI Agent Tools

  • AI Agent Tools for Firefox Development

Releases & Updates

  • Release Management
  • Mozilla Update Infrastructure
  • Watershed Updates
  • Desupport Updates
  • Update Verify

Localization & Internationalization

  • Internationalization
  • Localization

Firefox and Python

  • mozbase
  • Using third-party Python packages

Metrics Collected in Firefox

  • Firefox metrics
Firefox Source Docs
  • Working on Firefox
  • Searchfox
  • Searchfox Query Language Documentation
  • Report an issue / View page source

Searchfox Query Language Documentation

Searchfox provides a powerful query language for searching code repositories. The system is designed with simplicity in mind - you can start with basic searches and refine them interactively, while also supporting advanced query syntax for power users.

Table of Contents

  • Searchfox Query Language Documentation

    • Basic Search

    • Query Parameters

      • Case Sensitivity

      • Regular Expressions

      • Path Filtering

    • Advanced Query Syntax

      • path:

      • pathre:

      • Context

      • Search Type Terms

        • symbol:

        • id:

        • text:

        • re:

        • nresult:

    • Sharing and Collaboration

Basic Search

The simplest way to search is to just type what you’re looking for. No special syntax is required:

https://searchfox.org/mozilla-central/search?q=AudioContext

This will search for:

  • Text occurrences in files

  • Symbol/identifier matches (prefix-based)

  • File names containing the term

The path filter input on the right hand side supports glob patterns that supports the following features:

  • * : matches any characters except path separators (/)

  • ** : matches any characters including path separators

  • ? : matches any single character

  • {a,b,c}: matches any of the comma-separated alternatives

  • ^ and $: regex anchors (preserved as-is)

  • Literal parentheses, pipes, and dots are escaped

The same syntax is used whenever globbing is expected in searchfox.

Query Parameters

Searches can be customized using URL parameters:

Case Sensitivity

  • Parameter: case

  • Values: true for case-sensitive, anything else for case-insensitive (default)

https://searchfox.org/mozilla-central/search?q=AudioContext&case=true

Regular Expressions

  • Parameter: regexp

  • Values: true to treat query as regex, anything else for literal search

  • Note: Regex mode only performs textual content search, not semantic search unless symbol: or id: prefixes are used

https://searchfox.org/mozilla-central/search?q=AudioContext%3A%3A.*Panner*&regexp=true

Path Filtering

  • Parameter: path

  • Description: Filter results by file paths using glob patterns

  • Example: ?q=MyFunction&path=src/main/*

For example, finding media playback tests (not Web Audio tests that are in dom/media/webaudio/tests) that use an AudioContext:

https://searchfox.org/mozilla-central/search?q=path%3Adom%2Fmedia%2Ftest+AudioContext&path=&case=false&regexp=false

Advanced Query Syntax

The query language supports term:value syntax for more precise searches.

Important: term:value syntax must be placed before any search terms. The search endpoint stops parsing once it encounters an unrecognized term.

path:

Filters results by file paths using glob patterns (same as path parameter):

path:src/components/* MyFunction

pathre:

Filters results using regular expressions for paths:

pathre:^src/(main|test)/.*\.js$ MyFunction

Example, finding all tests for the PannerNode, in WPT and Mochitests:

https://searchfox.org/mozilla-central/search?q=pathre%3Atesting\%2Fwpt|dom\%2Fmedia\%2Fwebaudio\%2Ftest+PannerNode

Context

Allows displaying the result and surrounding context. A current limitation is that this only works with fulltext search via text: or re: and if you forget to use one, you may get semantic results without any context.

context:3 re:AudioContext::.*Create

Search for all factory methods of an AudioContext, with 3 lines of context, above and below the search hit:

https://searchfox.org/mozilla-central/search?q=context%3A3+re%3AAudioContext%3A%3A.*Create

Search Type Terms

symbol:

Search only for symbols/identifiers

symbol:cubeb_stream_init
  • Multiple symbols can be comma-separated: symbol:Foo,Bar

  • Dot notation is normalized to hash: symbol:obj.method becomes symbol:obj#method

  • Note: in C++, this requires the mangled symbol name, and so it is best access by clicking on a member

id:

Exact-match identifier search (not prefix-based like the default search):

id:main

This means id:creategain won’t match createGainNode() calls, that are also present indexed code.

text:

Exact text match, this escapes regexp characters

text:function main()

re:

Treat remainder of query as regular expression

re:get\w+Value

nresult:

Show the nsresult definition for given hex or decimal notation.

nsresult:0x80004005
nsresult:80004005
nsresult:2147500037

Sharing and Collaboration

All non-default searches are encoded in URLs, making them easy to bookmark for later use, sharing with team members, include in documentation or bug reports, and building into automated tools.

When including a searchfox link in source code, consider using a permalink to a revision when it makes sense.

Update Schedule: It takes up to 12 hours for trees other than the Firefox tree to receive the latest enhancements and fixes.

Previous Next

Built with Sphinx using a theme provided by Read the Docs.