| name | source-permalinks |
| description | Reference for constructing revision-pinned source, spec, and bug permalinks (Searchfox, GitHub, GitLab, googlesource, Codeberg, Chromium, FFmpeg, Bugzilla, specs). Use when citing code, specs, or bugs in analysis or reports and you need stable, revision-pinned URLs instead of trunk/HEAD links. |
Source Permalink Reference
Golden Rule
Always use revision-pinned URLs in analysis documents. Never use trunk/tip/HEAD URLs.
When to Link
- Source files and functions (Firefox, Chromium, any open-source project)
- Specification sections (WHATWG, W3C, TC39, IETF, etc.)
- Bug reports (Bugzilla, GitHub Issues, Chromium Issue Tracker)
- Documentation pages
- Any other web-accessible resource
Anchor Text Rules
- Use function name, identifier, or short description as anchor text — not raw URL
- If citing a line range, use the starting line
- If no specific line known, link to file root
- Apply in all contexts: prose, tables, code snippets, plans
Searchfox (Firefox, WebKit)
URL Format
https://searchfox.org/{repo}/rev/{hash}/{path}#{line}
https://searchfox.org/{repo}/rev/{hash}/{path}#{start}-{end}
Repository Table
| Repo ID | Description |
|---|
| firefox-main | Firefox trunk (primary) |
| firefox-beta / mozilla-beta | Beta branch |
| firefox-release / mozilla-release | Release branch |
| firefox-esr115 | ESR 115 |
| firefox-esr128 | ESR 128 |
| firefox-esr140 | ESR 140 |
| wubkat | WebKit |
Revision Resolution Strategy
- Get local revision:
git rev-parse HEAD
- Validate on searchfox: WebFetch
https://searchfox.org/firefox-main/rev/{hash}/moz.configure
- If 200: use this hash for all links in the session
- If 404 (searchfox hasn't indexed this rev yet): fetch
https://searchfox.org/firefox-main/source/moz.configure and extract the indexed revision from the page content
- Cache the validated revision for the entire session ($SHERLOCK_REV)
- For ESR/beta branches: repeat with the appropriate repo ID
Mercurial Hash Compatibility
https://searchfox.org/{repo}/hgrev/{hg-hash}/{path}#{line}
Automatically converts Mercurial hashes to Git revisions.
GitHub
https://github.com/{owner}/{repo}/blob/{hash}/{path}#L{line}
https://github.com/{owner}/{repo}/blob/{hash}/{path}#L{start}-L{end}
GitLab
https://{host}/{owner}/{repo}/-/blob/{hash}/{path}#L{line}
Known hosts: gitlab.xiph.org, code.videolan.org
googlesource.com
https://{host}/{repo}/+/{hash}/{path}#{line}
Known hosts: chromium.googlesource.com, aomedia.googlesource.com, webrtc.googlesource.com
Codeberg
https://codeberg.org/{owner}/{repo}/src/commit/{hash}/{path}#L{line}
Chromium Code Search
https://source.chromium.org/chromium/chromium/src/+/main:{path};l={line}
Note: source.chromium.org does NOT support revision pinning in URLs.
For pinned Chromium links, use the googlesource.com mirror:
https://chromium.googlesource.com/chromium/src/+/{hash}/{path}#{line}
FFmpeg (via GitHub mirror)
https://github.com/FFmpeg/FFmpeg/blob/{hash}/{path}#L{line}
The Firefox moz.yaml revision maps to a git commit on this mirror.
Bugzilla
https://bugzilla.mozilla.org/show_bug.cgi?id={id}
Anchor text: [Bug {id}](URL)
Specifications
Trusted spec domains:
- html.spec.whatwg.org — WHATWG HTML Standard
- w3c.github.io — W3C specs (WebCodecs, MSE, EME, etc.)
- webaudio.github.io — Web Audio API
- tc39.es — ECMAScript
- datatracker.ietf.org — IETF RFCs
- www.rfc-editor.org — RFC editor
- itu.int — ITU-T codec specs (H.264, H.265)
Format: [Section Name](full URL with anchor)
Examples
Searchfox (revision-pinned):
MediaDecoder::Shutdown
Searchfox (WebKit):
MediaPlayer::pause
GitHub:
nestegg_read_packet
GitLab:
dav1d_decode
googlesource.com:
vpx_codec_decode
Chromium (pinned via googlesource):
MediaFoundationCdm::OnHardwareContextReset
Codeberg:
SoundTouch::processRemainingFrames
FFmpeg:
avcodec_send_packet
Spec:
HTML Standard §8.5 — The media element
Bug:
Bug 1234567