Show Close Button In Last Tab with Firefox 3.5

Posted: July 6th, 2009 | Author: jriggs | Filed under: firefox | Tags: , , , , | 11 Comments »

In the latest version of Firefox if you only have 1 tab open, that tab will not have the close button on it.  You can still close this tab using the menu, or the ‘ctrl+w’ shortcut.

close button on last tab

If you would like to add the button back, you’ll need to edit the userChrome.css file the Firefox uses.  On my XP computer it is located here:

C:\Documents and Settings\<your_account>\Application Data\Mozilla\Firefox\Profiles\ftz0ce5v.default\chrome

On OS X you will find this file here:

~/Library/Application Support/Firefox/Profiles/ftz0ce5v.default/chrome/

Note that ‘ftz0ce5v’ is randomly generated by Firefox so you will see something slightly different.  Once in this directory you should see a file named ‘userChrome-example.css’.  Make a copy of this file in the same directory and rename it to ‘userChrome.css’ (if it doesn’t already exist).

Open the file you have just created an add the following lines:

.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 will see the last open tab now has a close button. Original code and other nifty customizations found here.

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Reddit
  • RSS
  • StumbleUpon

Related posts:

  1. Remove New Tab Button From Firefox 3.5
  2. Useful Shortcuts For Firefox
  3. Use FireGestures to Open Your Favorite URL
  4. Firefox Clear History Not Working – version 3.5.7
  5. Disable javascript in Firefox

11 Comments on “Show Close Button In Last Tab with Firefox 3.5”

  1. 1 SJ said at 10:36 am on July 23rd, 2009:

    This does not work on my mac.

  2. 2 SJ said at 1:26 pm on July 23rd, 2009:

    I am using the Grapple Delicious theme. That may be an issue. If I use Command W to close the last tab I see the close button for a second then it disappears. Any thoughts? Steve.

  3. 3 jriggs said at 5:33 pm on July 23rd, 2009:

    Hi SJ

    Unfortunately I don’t have a Mac to test on right now, but I’m pretty sure that your theme is what’s causing the problem. To double-check, disable the theme and see what happens.

  4. 4 SJ said at 6:59 pm on July 27th, 2009:

    Joe, you were 100% right. Thank you. Sorry I didn’t think to check that. Your help with these “minor” issues are massively appreciated by me and others.

  5. 5 yoblin said at 11:28 pm on July 28th, 2009:

    or:

    about:config -> browser.tabs.closeWindowWithLastTab = false

  6. 6 Sheldon (Marketing Consultant, Tauranga) said at 5:08 am on August 17th, 2009:

    Ahhhhh thanks brother, it is so friggen good to get that back!!

  7. 7 Sheldon (Marketing Consultant, Tauranga) said at 5:09 am on August 17th, 2009:

    And by the way Yoblin, your fix didn’t work!

  8. 8 Sheldon (Marketing Consultant, NZ) said at 8:31 pm on August 18th, 2009:

    Got Windows Vista? It’s easy with this plugin: https://addons.mozilla.org/en-US/firefox/addon/12991

  9. 9 Chip said at 7:31 pm on August 30th, 2009:

    THANK YOU SO MUCH! especially for that tab plus sign article!

  10. 10 Name said at 2:20 am on August 31st, 2009:

    Great! Thanks very much!

  11. 11 Francois said at 2:06 pm on September 8th, 2009:

    Great tip, much appreciated, thanks.