When I use Firefox, I've noticed that there are perhaps a dozen menu items that I never use. For instance, I never try to open a new window (instead, I use tabs); I never use any of the send link/page/image to variants, since I use gmail and haven't ever set up a email client within firefox. I never use the Work Offline button (I don't really know what it means).
Same thing with the right-click context menus. I don't right click a page to stop loading, instead I hit escape. I never copy image contents, set desktop background (in fact, my window manager is set up so that my background is a terminal window).
Most importantly of all, I never never never mean to hit the File -> Quit menu item; most likely I mean to hit File -> Close Window, which is inconveniently located in the middle of the menu. In terms of keystrokes, ALT-F down down down is much farther away than ALT-F up.
So, If I never use these menu items, why do I have to filter through them every time I use my web browser?
Well, now I don't, and the screenshot at left demonstrates the newer, smoother, less-crufty layout. Here's how you do it yourself:
It turns out that all of the user interface widgets in firefox are defined in a series of XUL files. By modifying these files, we can make our menu layouts match our personal use cases.
A moment of caution, however. XUL files are XML documents, and they are tightly coupled with other parts of the software. Who know how many calls times firefox calls document.getElementById() and doesn't check the return value. Don't risk it. Instead of removing items from this file, or even commenting them out, we're going to set the XUL hidden="true" attribute for undesirable menu items. Similarly, if you are moving elements, you may want to preserve the parent-child structure of the document, or you may break some XPath query hidden in firefox' gut.
It should also go without saying that you should backup every file you modify. Having said that, I'm not responsible for you.
Find your firefox installation directory. On my computer, this is /usr/local/bin/firefox; on windows, I would guess it's in C:\Program\ Files. Within this directory, you will find a subdirectory called chrome/, which contains a series of .jar files. Our target is browser.jar.
Copy browser.jar to browser.jar-old right now, before you forget. Oh yeah, close firefox.
Now copy browser.jar to a temporary directory, and unzip it with whatever tool you use. If you have trouble with this step, rename it to browser.zip, and unzip that.
You should see a directory called content/browser/, and in this directory, a series of .xul files. We are interested in content/browser/browser.xul. Open it up with vi, and look at it until you understand how it works.
For our purposes, you only need to understand the meaning of a new elements.
< popupmenuset > - here, popup refers to popup menu. The main popup set is the main menu bar used in firefox, and it contains the File, Edit, View, etc menus. < menupopup > - this can refer to a popup menu (such as the File Menu) or to a context menu (like when you right-click on the page).
And to re-order misplaced menu items, re-order the
- dom.disable_window_open_feature.menubar, dom.disable_window_move_resize, dom.disable_window_move_resize, dom.disable_window_move_resize, dom.disable_window_move_resize, dom.disable_window_open_feature.titlebar, dom.disable_window_open_feature.titlebar must all be set to false to avoid annoying behavior;
- browser.tabs.closeButtons = 2, to put the close tab button on the right, not on each tab (like firefox 1.5);
- browser.backspace_action = 0, so that backspace is equivalent to the Back button;
- browser.chrome.toolbar_tips = false, to hide tool-tips; and,
- browser.tabs.tabMinWidth = 75, so it will show more tabs before scrolling them.