Get a cool sliding menu bar in Firefox

By webmasterbyname

Let’s face it, Firefox is way too greedy when it comes to screen real estate – in its default configuration anyway:

 Default Firefox interface (1024x145)

With the status bar and Windows task bar at the bottom of the screen, you don’t have a lot of screen space left for actually viewing web pages!

Bottom of your Windows screen (1024x52)

In fact, on a standard 1024 x 768 screen, all these bars take up a quarter of your screen height (197 pixels works out to 25.7%).

Consolidating the chrome

Last week, Gina Trapani over at Lifehacker gave out some great tips about consolidating the chrome (the control area or interface) of your Firefox browser. You should go and read that article now if you haven’t already. I’ll wait. Read Lifehacker article >>

If you’ve implemented some of Gina’s tips, your Firefox chrome might look something like this (now with 7.7% more browsing space).

Consolidated Firefox chrome (1024x86)

I also use the All-in-One Sidebar extension which collapses to a very thin gray bar and gives me quick access to my History, Bookmarks, and Scrapbook.

Sliding menu bar

The only menu I use on a semi-regular basis is Tools, but I still need access to the other menus once in a while, so I can’t get just rid of them (Gina at Lifehacker showed us how). But if you consider how little I use them, they’re still taking up too much space on my toolbar.

I could use the Tiny Menu extension, which I also discovered at Lifehacker. But then it would take two clicks to get to any menu, and the Menu text looks a bit strange on the toolbar.

Tiny Menu Firefox extension

I love my Firefox extensions, but I also love efficiency and I won’t install an extension if I can do the same thing in another way. In my search I found this really cool userChrome.css hack. The menus are replaced with a single icon …

Sliding menu bar - hidden

… but they are still easily accessible by simply hovering the cursor over the icon, which temporarily unhides the menus …

Sliding menu bar - visible

The code

This is the code that does the trick – but it’s not quite complete (see below).

/* Sliding menu bar - hidden until mouse hover
from [http://userstyles.org/style/show/993] */
#menubar-items {
background-image: url("ImageData") !important;
background-repeat: no-repeat !important;
background-position: 5px center !important;
padding-left: 24px !important;
}
#menubar-items > #main-menubar {
display: none !important;
}
#menubar-items:hover > #main-menubar {
display: -moz-box !important;
}

Add the above code to your userChrome.css file (what? how?), and then replace ImageData (line 4) this way:

  1. Click here (this text file is hosted elsewhere because .txt files cannot be uploaded to wordpress.com)
  2. Select the whole string in the text file – you can do this by pressing CTRL+A
  3. Press CTRL+C
  4. Go back to your userChrome.css file
  5. Select ImageData in line 4 (nothing more, nothing less)
  6. Press CTRL+V

Save your changes to userChrome.css and restart Firefox. You just replaced ImageData with a base-64 data string (containing 1600 characters) that basically encodes the icon for your new menu within your userChrome.css file.

If you don’t like the Firefox icon in your new chrome, you can upload your preferred icon to The data: URI kitchen (be sure to tick base64) and then insert the generated data string into your userChrome.css file in place of the current string.

The trade-off

Unfortunately, the menus are no longer available via keyboard shortcuts (e.g.. ALT+T for the Tools menu), but that shouldn’t be a great loss if you seldom use them anyway.

from Sliding Menubar by LouCypher [userstyles.org]

7 Responses to “Get a cool sliding menu bar in Firefox”

  1. Spreading the Firefox 2 Love « //engtech Says:

    [...]  UPDATED 2006/11/02:  a neat trick for reducing the Firefox menu bar to increase screen real estate. [...]

  2. webmasterbyname Says:

    Thanks for having a look around here.

    I’m in the middle of exams at the moment, but once they’re over the posts should become a bit more frequent.

  3. redcords Says:

    I quite like this, there are two things in the code above I had to change to get it to work:

    background-image: url(“ImageData“) !important;

    the 2nd quote needs to be a normal quote.

    #menubar-items > #main-menubar {

  4. redcords Says:

    hmm quoting the 2nd line stopped the rest of the comment.

    basically there is a less than sign at the end of the 2nd line that needs to be removed.

  5. webmasterbyname Says:

    Well done on picking that up! Sorry about those typos, redcords (and anyone else out there).
    I’ve removed the less than sign that shouldn’t have been there, but I can’t get the 2nd double quote to straighten-up – do you know why that would be?
    Anyway, I’m glad you liked the tweak. I thought it was pretty neat too!

  6. redcords Says:

    I don’t know much about wordpress but I think it’s fiddling with the quotes.

    One thing I’d like to do for this tweak is to have some selected menu(s) showing all the time, and have the rest appear when you hover. In my case I’d like to always have the bookmarks menu showing, I tried a few things but I couldn’t get it to show and have the hover show the rest.

  7. LouCypher Says:

    In my search I found this really cool userChrome.css hack.

    I wrote that ;)

    @redcords:
    Add \ to the end of every line of the image data:

    #menubar-items {
    background-image: url("data:image/png;base64,\
    iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsSAAALEgHS\
    ...\
    ...\
    qQcIMACDoJbT47bbfAAAAABJRU5ErkJggg==") !important;

    or use the code at http://zoolcar9.lhukie.net/mozilla/userstyles/slidingMenubar.css

    Unfortunately, the menus are no longer available via keyboard shortcuts (e.g.. ALT+T for the Tools menu),

    Good news, achilles has a nice trick for it.

Leave a Reply

You must be logged in to post a comment.