How to restore Firefox 3.5 close button on last tab

I should have posted this right after Firefox 3.5 was released, but I guess it’s better late than never. I am posting so people will have one more resource for solving a UI issue that I considered a problem: in FF 3.5, the last tab no longer shows the close button, so you can no longer close all tabs in the browser without closing the browser itself. I assume they made this change because of the new “add a tab” button that appears to the right of the right-most tab (see image following this paragraph for visual aid). Of course, on a non-last tab, the “add new tab” button is next to the close button, so my hypothesis is not very solid.

Close button next to "add a new tab" button

Close button next to "add a new tab" button

To restore the close button on the last tab, do these two things:

  1. Open a new tab and type “about:config” in the address bar. Type “closeWindow” to filter the list and you should see browser.tabs.closeWindowWithLastTab as the only option listed. If it is set to “false,” double click the option to change it to “true.” This will prevent the browser from closing when you close the last tab. This is technically optional, but most likely something you will want set when you restore the close button on the last tab.
  2. Locate the Firefox userChrome-example.css file on your hard drive — for Windows Vista, it is located in <User Name>/AppData/Roaming/Mozilla/Firefox/Profiles/<alphanumeric>.default/chrome. Substitute “User Name” for the logged-in user name, and “alphanumeric” will be an alphanumeric combination with the word “.default” attached to the folder name. Copy and paste the userChrome-example.css
    file and rename it to userChrome.css. Open the file and add the following code to it, under the line that starts @namespace (line 15):
    .tabbrowser-tabs[closebuttons="alltabs"] > .tabbrowser-tab > .tab-close-button { display: -moz-box !important; } .tabbrowser-tabs:not([closebuttons="noclose"]):not([closebuttons="closeatend"]) > .tabbrowser-tab[selected="true"] > .tab-close-button { display: -moz-box !important; }

Restart Firefox and you should now have a close button on the last tab, and this last tab can be closed without closing the browser. Enjoy Firefox 3.5!

No Comments
July 26, 2009 in Development

Leave a Reply

Using Gravatars in the comments - get your own and be recognized!

XHTML: These are some of the tags you can use: <a href=""> <b> <blockquote> <code> <em> <i> <strike> <strong>