How to show bookmarks toolbar only on new tabs in Firefox

With Firefox 84 (I'm on beta / dev edition), there is an option to do this; If you don't see it:

  1. Go to about:config and toggle browser.toolbars.bookmarks.2h2020 to True.
  2. You may need to restart your browser
  3. Afterwards, you can find the option in your menu bar:

enter image description here


It's a bit of a workaround, but you can do this by creating a custom userChrome.css rule. This works by leaving the bookmarks toolbar enabled all the time, and hiding it unless the tab title matches the title of your New Tab. This should work in versions of firefox 57 and up (through at least the current beta, 63).

Here is the kb article about userChrome. I cobbled this solution from several sources, including this reddit thread. To summarize (for Windows because that's what I'm on):

  1. Enable the bookmarks toolbar permanently.
  2. Go to your firefox profile in your file browser. On Windows this is %userprofile%\AppData\Roaming \Mozilla\Firefox\Profiles\[random-id].default\.
    • Note: There can be multiple profiles, you may be able to distinguish yours by inspecting the contents of the profile, for example under the extensions directory.
  3. Under your firefox profile, create a new folder named chrome. It should be something like \...\Profiles\[random-id].default\chrome\
    • Note: "chrome" here means "user interface" and doesn't have anything to do with the Chrome browser.
  4. In that new folder, create a plain text file named userChrome.css
  5. Open a new tab and note down the title exactly. It will probably be just Firefox. Mine says Firefox Developer Edition because I'm on the dev channel.
  6. Copy the below css rule into this plain file with a text editor like notepad. Then edit the quoted title to match the title of your new tab.
  7. Save the file and restart Firefox.

Here is the css rule:

/* show bookmarks toolbar on new tab only */
#main-window:not([title^="Firefox Developer Edition"]) #PersonalToolbar {
  visibility:collapse !important;
}

This works ok, but there are some drawbacks:

  • Since the toolbar is already always 'present' but hidden, this means you can only access the bookmarks toolbar from a new tab. It becomes impossible to access from another page. This is an acceptable tradeoff for me.
  • If you are always using sidebars or sidebar-based extensions like Tree Style Tabs, the sidebar will always show below the toolbar, meaning that when you open a new tab the sidebar will temporarily shift down until you navigate away. This doesn't really affect usability besides looking a little janky.