Jul 27th

Firefox 4 and minimum / maximum tab width

2010, 06:20 UTC | By | In Mozilla
Leave a comment | Trackback  | 11953 views

Want smaller tabs?

While playing around with Firefox 4 testing builds, I found myself being unable to set a minimum tab width in the way it was working with FF 2 or 3 where you could set the config variables:

  • browser.tabs.tabMinWidth for the minimum width of tabs before adding the scrolling ability
  • browser.tabs.tabMaxWidth for the maximum allowed width for a single tab.

In current "Minefield" builds of Firefox 4, these configuration variables simply do not work any longer and that's something I found disturbing, because the default (and now apparently hardcoded) limit for the minimum width of 140 pixels is way to high when working with lots of tabs.

Solution:

The values can be overridden in userChrome.css with the following code:

.tabbrowser-tab:not([pinned]) {
  max-width: 250px !important;
  min-width: 40px !important;
}

See this issue for reasons why the config variables do no longer work. They were recently removed from the code and possible solutions require userChrome.css editing.

Update:

While the information above is still valid for Firefox 4, there is an issue that affects tab animation. For some reason, animated tabs will produce glitches when you change the default tab width via userChrome.css (like I have outlined it in the article above).

So far, the only way to fix this was to disable tab animations in Firefox 4 by setting the browser.tabs.animate configuration variable to false. However, many people like the animations and would probably love to keep them while still being able to reduce the minimum tab width.

As described in this bugzilla report and submitted in the comments section of this article, there is a solution for the animation issue:

.tabbrowser-tab:not([fadein]) {
   max-width: 1px !important; min-width: 1px !important;
   max-width: 1px; min-width: 1px;
 }

Add the code above to your userChrome.css and you should be able to use tab animations together with the modification for the default minimum and maximum tab width.

Credits:

Tip for fixing the tab animation issues submitted by anonymous comment author.

1 Like Like
 

11 responses to: Firefox 4 and minimum / maximum tab width

  1. michal.dvorak, Aug 15th, 2010 at 14:11
    Reply | Quote | #2

    Thanks man, I've been looking for this.

  2. Luk, Aug 25th, 2010 at 22:23
    Reply | Quote | #3

    Thanks a lot !

    I was wondering if I was going crazy or if it no longer worked!

    Note that I have apparently an animation bug now, but it's still better than nothing!

  3. Admin, Aug 26th, 2010 at 00:06
    Reply | Quote | #4

    The animation bug is a known issue when you change the minimum or maximum tab width. It should be assumed that it will be fixed for the final Firefox 4...

    Current solution: disable animations - see here http://blog.miranda.or.at/mozilla/animated-tabs-i...

  4. nonW00t, Nov 22nd, 2010 at 08:28
    Reply | Quote | #5

    First the status bar is gone (for all intents & purposes other than add-on icons only), now this! Come on Mozilla, snap out of it. lol

  5. Joey, Mar 17th, 2011 at 09:43
    Reply | Quote | #6

    Thank you! The default minimum width was really annoying me.

  6. Anonymous, Apr 14th, 2011 at 00:25
    Reply | Quote | #8

    I had the same problem. Thank you for helping.

  7. Anonymous, Apr 14th, 2011 at 00:49
    Reply | Quote | #9

    To prevent animation glitch, u must also change in about:config :
    browser.tabs.animate true -> false

    • Admin, Apr 16th, 2011 at 05:07

      <blockquote cite="#commentbody-28885">
      Anonymous :
      To prevent animation glitch, u must also change in about:config :
      browser.tabs.animate true -> false

      Yes, this bug has not yet been fixed. I mentioned it here (http://blog.miranda.or.at/mozilla/animated-tabs-in-firefox-4-nightly).

      Better UI animations are on the road map for Firefox 5, so there is hope that this will be fixed soon.

      • Anonymous, May 16th, 2011 at 21:40

        Instead of disabling animation to fix the glitch, you can also try adding:

        .tabbrowser-tab:not([fadein]) {

        max-width: 1px !important; min-width: 1px !important;

        max-width: 1px; min-width: 1px;

        }

        to the userChrome.css.

        Source: https://bugzilla.mozilla.org/show_bug.cgi?id=5746...

        • Admin, May 16th, 2011 at 22:06

          Thanks for this.

          I've updated the article to include this important fix so people can keep animations enabled and still change the default tab width to their personal preference.

  8. Robert, Apr 10th, 2012 at 21:04

    Thanks guys!!!!!

    Btw, anyone confused by the directions, the userChrome.css file is supposed to be in:

    C:\Users\{user}\AppData\Roaming\Mozilla\Firefox\Profiles\{profile}.default\chrome\userChrome.css

    If the file does not exist (which it did not for me), you can create it in that directory above.

Subject

  (this is optional)

Comment text

Allowed HTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>