Smart Tab Renamer

Firefox extension to rename tabs by hand or automatically with rules. Titles stay put, even when a site tries to change them.

Overview

Many websites give their tabs long or changing titles: unread counts, notifications, or the same name on every page. That makes tabs hard to tell apart. Smart Tab Renamer lets you decide what each tab is called.

There are two ways to use it, and most people only need these:

  • Rename one tab by hand. Right-click it, type a name, done.
  • Write a rule. Name a website once and every tab from it is renamed for you.

The name you choose is kept when the page reloads and when the site tries to change it back. Everything else on this page is optional and can be learned one step at a time.

Install

Smart Tab Renamer needs Firefox 142 or later.

  1. Open the latest release on GitHub.
  2. Download the file that ends in .xpi and open it with Firefox.
  3. Confirm when Firefox asks to add the extension.

Try it without installing

  1. Download or clone the source code.
  2. In Firefox, open about:debugging#/runtime/this-firefox.
  3. Choose Load Temporary Add-on… and select the file manifest.json.

An add-on loaded this way is removed when Firefox is closed.

Basic Usage

Rename one tab

  1. Right-click the tab, or anywhere on the page, and choose Rename Tab…. You can also click the Smart Tab Renamer button in the toolbar.
  2. Type the name and choose Apply, or press Enter.
The Rename Tab popup. A Tab name field holds the text Sprint board. Below it is the page address, which cannot be changed, followed by a note that the address has parts after a question mark or hash sign, so the name applies only while the whole address stays the same. The buttons are Remove name and Apply.
The rename popup. The note appears when the address has parts after ? or #.

The name belongs to that exact page address and is used every time you open the page. To go back to the page's own title, right-click the tab and choose Clear Custom Name.

“Exact” includes anything after ? or # in the address. When the address has such parts, the popup says so, because the name stops applying if they change. See exact addresses for what to do instead.

Rename every tab from a website

A rule does the renaming for you. First open the settings page: click the toolbar button and choose Open all rules and settings. (You can also go to about:addons, choose Smart Tab Renamer, then Preferences.)

  1. In Website, type the site, for example github.com.
  2. In Tab title, type the title you want, for example GitHub.
  3. Choose Add rule.
The Add a rule form on the settings page. The Website field holds github.com and the Tab title field holds GitHub. A closed More options section and an Add rule button are below.
A first rule: the website, the title you want, then Add rule.

Every tab from that website now shows your title, including tabs that are already open. The rule appears under Your rules section.

Shortcut

To make a rule for the page you are on, right-click the tab and choose Copy Rule From Current Tab…. The settings page opens with the website and title already filled in.

Advanced Settings

Each step adds one idea, and you can stop after any of them. Steps 1 to 8 go from simplest to most advanced.

Step 1: Build a title from parts of the page

A fixed title such as “GitHub” makes every tab from the site look the same. A placeholder keeps part of the page in the title, so tabs stay different.

  1. Click in the Tab title field.
  2. Choose one of the buttons under it, such as Page title. The placeholder is added where the cursor is.
The Tab title field holding GH: %title%. Under it, four buttons labelled Page title, Website name, Page path and Container name.
The buttons under Tab title insert a placeholder for you.
Placeholders you can use in a tab title
Placeholder Button Replaced with Example
%title% Page title The page's own title Pull requests
%hostname% Website name The website's address github.com
%path% Page path The part of the address after the website /mozilla/web-ext
%container% Container name The tab's container, or “Default” Work
%url% (type it) The full page address https://github.com/mozilla/web-ext

Example

The title GH: %title% turns a page titled “Pull requests” into “GH: Pull requests”, and a page titled “Issues” into “GH: Issues”.

Step 2: Choose exactly which pages match

A new rule matches a whole website. To match more or fewer pages, open More options in the rule form and change Match. The first field's label and example change to show what to type.

The rule form with More options open. Match is set to Pages whose address starts with, so the first field is now labelled Address starts with and holds https://github.com/mozilla/. Container is Any Container and Priority is 20.
More options open, with Match set to an address prefix. Container and Priority are next to it.
Ways a rule can match, from widest to narrowest
Match Which pages What to type
A website and all its subdomains The site and every address in front of it, such as jira.company.com *.company.com
A website Every page on that one site, with or without www. github.com
Pages whose address starts with… One section of a site https://github.com/mozilla/
One exact page Only that address https://mail.google.com/mail/u/0/
A regular expression Any address the expression matches. See step 8. ^https://.*\.example\.com/

For the last three, type the full address, starting with https://.

Addresses often carry URL parameters after ? or #, and those parts change as you move around a site. When the address you type has them, a note appears under the field and says what the rule will and will not match:

  • One exact page matches only while the whole address, including those parts, stays the same.
  • Pages whose address starts with… works best with those parts left out, so that every page under the address matches.
  • A website uses only the site. If you paste a whole address, the note shows which site will be used.
The Exact page address field holding a Google Sheets address that has parts after a question mark and a hash sign. A note under the field says the rule applies only while the whole address stays the same, and suggests the match type Pages whose address starts with.
The note that appears when an exact address has parts after ? or #.

Step 3: Test a rule before you save it

  1. Fill in the rule, then open More options and find Try the rule.
  2. In Sample page address, paste the address of a real page.
  3. In Sample page title, type that page's title.

Resulting tab title shows what the tab would be called. It updates as you type, so you can adjust the title until it reads the way you want.

The Try the rule section. The sample page address is https://github.com/mozilla/web-ext and the sample page title is web-ext: a command line tool. The resulting tab title reads Mozilla: web-ext: a command line tool.
Try the rule shows the title a real page would get.

Step 4: Decide which rule wins

Two rules can match the same tab. Each rule has a Priority number, and the rule with the lowest number wins.

The number is set for you from the match type, so that a narrower rule beats a wider one: one exact page is 10, an address prefix is 20, a website is 30, a website and its subdomains is 40, and a regular expression is 50. You can type a different number under More options.

Example

You have a rule for the website github.com with the title GitHub, and a rule for addresses starting with https://github.com/mozilla/ with the title Mozilla: %title%. Pages under /mozilla/ match both. The second rule wins, because its priority (20) is lower than the first rule's (30).

When two matching rules have the same priority, the one higher in the list wins. Use the ↑ and ↓ buttons to change the order.

Step 5: Give one site different names per container

If you use Firefox containers, a rule can apply to one container only. This is how you tell apart two accounts on the same website.

  1. Add a rule for the website as usual.
  2. Open More options and choose a Container.
  3. Add a second rule for the same website and another container.

Example

Two rules for mail.google.com: one for the container “Work” with the title Work Mail, and one for “Personal” with the title Personal Mail. Or use a single rule for any container with the title %container% Mail.

Step 6: Sort tabs into tab groups

A rule can also move its tabs into a Firefox tab group. This is off until you turn it on.

  1. On the settings page, under Preferences, turn on Move matching tabs into tab groups.
  2. Add or edit a rule, open More options, and type a Group name. Groups that are open now are suggested as you type.
  3. Pick a Group color and save the rule.
The preference Move matching tabs into tab groups, with its switch turned on.
First, turn the preference on.
The Tab group part of More options. Group name holds Work and Group color is set to Blue.
Then name the group in the rule, under More options.

How grouping behaves:

  • A tab joins the group with that name in its own window. The group is created if it does not exist.
  • Tabs are moved when they load a page. A tab you drag out of its group stays out until it loads a page again.
  • Pinned tabs are left alone, because grouping a pinned tab would unpin it.
  • Tabs that match no rule are never removed from a group.

Example

To keep all work sites together without renaming them, give each site's rule the group name Work and the title %title%, which leaves the page's own title as it is.

Step 7: Let bookmarks name your tabs

With Use bookmark names turned on in Preferences, a page you have bookmarked takes its bookmark's name as the tab title. This happens before any rule is applied, so a bookmark's name beats a rule. It is on when you first install the extension; turn it off if you would rather have your rules decide.

Step 8: Capture part of the address with a regular expression

This is the most flexible match type, for people who are comfortable with regular expressions. The expression is tested against the full page address. Text captured by round brackets can be used in the title as $1, $2, and so on up to $9.

  1. Open More options and set Match to A regular expression (advanced).
  2. Type the expression in the first field.
  3. Use $1 in Tab title where the captured text should go.
  4. Check the result with Try the rule (step 3).

Example

Expression: ^https://jira\.company\.com/browse/([A-Z]+-\d+)
Tab title: $1 - %title%
The page https://jira.company.com/browse/PROJ-123 titled “Fix login” becomes “PROJ-123 - Fix login”.

The complete rule form for the example. The Regular expression field holds the expression, Tab title holds $1 - %title%, Match is A regular expression (advanced) and Priority is 50. In Try the rule, the sample address ends in PROJ-123, the sample title is Fix login, and the resulting tab title reads PROJ-123 - Fix login.
The example above in the rule form, checked with Try the rule.

An expression that is not valid is reported when you save the rule.

Step 9: Review your rules

Rules are listed under Your rules section. The list shows a few rules at a time and scrolls when there are more. Each rule has these controls:

The Your rules list with six rules. Above it are a search box and two filters. Each row has an On checkbox, what the rule matches, its tab title, options such as Container: Work, its priority, and the buttons Edit, Duplicate, move up, move down and Delete.
Your rules, with the search box and filters above the list.
  • On. Untick the box to switch a rule off without deleting it.
  • Edit. Loads the rule into the form. Change anything, then choose Save changes, or Cancel to leave it as it was.
  • Duplicate. Makes a copy just below the rule, as a starting point for a similar one.
  • ↑ and ↓. Change the order of rules that have the same priority.
  • Delete. Removes the rule. Choose Undo in the message that appears to bring it back.

With many rules, use the search box and the two filters above the list to find one by its website, title, group, match type or container.

Step 10: Review manually renamed tabs

Every tab you renamed with Rename Tab… is listed on the settings page under Manually renamed tabs, below your rules.

The Manually renamed tabs list with three entries. A round i button follows the description. The first address is a Google Sheets address with parts after a question mark and a hash sign; under it a note with an i button reads: Applies only while the parts after ? or # stay the same. The second entry is being edited: its page address and tab name are text fields, with Save and Cancel buttons. The other rows have Edit, Duplicate and Delete buttons.
Manually renamed tabs. The first address has parts after ? or #, so it carries a note. The middle row is being edited.
  • Edit. Change the tab name, the page address, or both. Press Enter or choose Save to keep the change, or Esc to cancel. The address must be the page's full address, beginning with https://.
  • Duplicate. Opens a copy just below, ready to edit. Give the copy a different page address and choose Save. Use this to give a similar name to another page without opening it first.
  • Delete. The page goes back to its own title or to a matching rule. Undo brings the name back.
  • Old names are forgotten. A name for a page you have not opened for 30 days is deleted. Change the number of days, or turn this off, in Preferences.

Good to know: the whole address has to match

A manual name applies to one exact page address, including anything after ? or #. If that part changes, the name no longer applies.

For example, a name given to https://docs.google.com/spreadsheets/d/xxx/edit?gid=984582641#gid=984582641 stops applying when you open another sheet in the same file, because the number after gid= changes.

On the settings page, every address in the list that has such parts carries a short note saying so. The same note appears under the address while you edit it. Choose the i button in the note, or the one next to the description, to read this explanation there.

To name the page whatever comes after, use a rule instead: set Match to “Pages whose address starts with…” (step 2) and enter the part that stays the same, such as https://docs.google.com/spreadsheets/d/xxx/.

Rule Precedence

When more than one name could apply to a tab, Smart Tab Renamer uses the first of these that exists:

  1. The name you gave that page with Rename Tab….
  2. The page's bookmark name, if Use bookmark names is on.
  3. The matching rule with the lowest priority number.
  4. The page's own title.

Preferences

Preferences are on the settings page, below the rules. A change is saved as soon as you make it.

Preferences and their starting values
Preference What it does Starts as
Use bookmark names A bookmarked page takes its bookmark's name, before any rule is applied. On
Move matching tabs into tab groups Lets a rule name a tab group and moves matching tabs into it. Off
Forget old manual tab names Deletes names for pages you have not opened for this many days. Enter 0 to keep them forever. 30 days
Debug logging Writes detailed messages to the browser console. See Troubleshooting. Off

Backup and reset

  • Export saves your rules and preferences to a JSON file. Manually renamed tabs are not included.
  • Import replaces your rules with the ones in an exported file. The file is checked first, and nothing is changed if it has a mistake in it.
  • Reset deletes every rule and every manually renamed tab. You are asked to confirm first.

Troubleshooting

A tab is not renamed

  • Check that the rule's On box is ticked.
  • Paste the page's address into Try the rule (step 3) to see whether the rule matches it.
  • Another name may be winning. See Which title wins.
  • If the rule is limited to a container, check that the tab is in that container.
  • A name given with Rename Tab…, and a rule set to One exact page, match the whole address. If the part after ? or # has changed, they no longer match. See exact addresses.
  • Firefox's own pages, whose addresses begin with about:, and the Firefox Add-ons website cannot be renamed by any extension.

A rule's tab group does nothing

  • Check that Move matching tabs into tab groups is on.
  • Reload the tab. Tabs are moved when they load a page.
  • Pinned tabs are never moved into a group.

A change is not saved

If a change cannot be saved, a message appears at the top of the settings page, or in the rename popup. Reload the page and try again. If it keeps happening, turn on debug logging and report it.

Collect details for a bug report

  1. On the settings page, turn on Debug logging under Preferences.
    The preference Debug logging, with its switch turned on.
    Debug logging, turned on.
  2. Open the Browser Console with Ctrl+Shift+J (on a Mac, Cmd+Shift+J).
  3. Repeat what went wrong.
  4. Copy the lines that begin with [SmartTabRenamer into a new issue on GitHub.
  5. Turn Debug logging off again.

Debug messages include the addresses and titles of your tabs. They are written only to your own browser's console and are never sent anywhere, but read them before you share them.

Kinds of message the extension writes
Level Meaning Written
Error An action failed and did not complete. Always
Warning Something went wrong, but a fallback was used and work continued. Always
Info Occasional events, such as start-up or rules being reloaded. Always
Debug Step-by-step detail, such as which rule renamed a tab. Only while Debug logging is on

Permissions used

Each permission is needed for one part of the extension.

  • tabs: to see a tab's address and title and to set its title.
  • storage: to save rules, manual names and preferences.
  • menus: to add the right-click menu entries.
  • contextualIdentities: to read container names for container rules.
  • cookies: required by Firefox to tell which container a tab is in.
  • bookmarks: to read bookmark names for the bookmark names option.
  • tabGroups: to read tab group names and move tabs into a group.
  • Access to all websites: to keep the chosen title in place on any page.

Privacy

Smart Tab Renamer collects no data. It has no analytics, no tracking and loads no remote scripts. Your rules and names are kept in Firefox's own extension storage. If you use Firefox Sync, they sync between your devices through your Firefox account.

About

Maintained by
Naveenchandar
Contributors
Everyone who has contributed on GitHub
License
MIT License
Feedback
Report a problem or suggest a feature