Searchfox tab titles now dynamically update

Skip to first unread message

Andrew Sutherland

Apr 5, 2021, 7:20:27 PMApr 5
to, Firefox Dev
You may have noticed that your Searchfox tab titles are much more
exciting than they used to be, especially if you mainly look at C++
code!  What's going on?

We start by selecting only the finest symbols using these artisanal
1) Current selection.  If you have selected a line by clicking on a line
number (and as is reflected in the URL hash), we attempt to figure out
what symbol is on the line you selected or, failing that, what's going
on with closest symbol that would result in a "position: sticky" being
displayed for that line.  You can de-select a line by control-clicking
on an already selected line.
2) Current "position: sticky".  If you haven't selected a line, we just
use the current most specific "position: sticky" thing you're looking at.
3) We give up and just show you the classic `${filename} - mozsearch`.

Once we've selected the finest symbols we:
1) Try and collapse things that perhaps are namespaces so your tab
titles aren't just namespaces.  "mozilla::dom::Foo::Bar" becomes
"m:d:Foo::Bar". "mozilla::dom::foo::Bar" becomes "m:d:f:Bar".
2) Put the classic title in parentheses.  So you get `m:d:Foo::Bar
(${filename} - mozsearch)`.

These heuristics are currently a little hacky but will hopefully be
improved by changes that will be landing as part of bug 1641372 that
provides searchfox with a more structured understanding of the codebase
that will let us know what is and isn't a namespace.

Relevant links for those looking to provide feedback or get more
involved (we're always looking for more contributors!):
- covers the
changes discussed here plus some thoughts about using the Clients API to
help reuse existing Searchfox tabs.
- covers landing
structured analysis changes and some potential changes to how we deal
- The current implementation is the `DocumentTitler` in
- covers some
deployment hiccups today that will be addressed by and

You can also provide feedback in the "Searchfox" channel on or the "Searchfox Outage" channel if your
feedback is more urgent in nature.


Reply all
Reply to author
0 new messages