Taming Firefox

From WTFwiki
Revision as of 16:34, 26 November 2007 by Jontow (talk | contribs) (→‎Tab Bar: fix typo)
Jump to navigation Jump to search

Firefox steals ram like crazy, when I leave it up for multiple days it's not uncommon to see it at 300 megs in ram. If you have less than 768 megs of ram, you probably want to tune it a little. Also, this is for firefox 2.x as they're pushing pretty hard to get people to migrate off 1.5 these days :(

Memory Usage

  • browser.cache.memory.enable - Set this to false to disable caching in ram and only use the disk
  • browser.cache.memory.capacity - Add this key to set how much ram the cache can use (in kb)
  • browser.sessionhistory.max_total_viewers - How many pages to store in the forward/back cache (about 4mb each?)
  • browser. sessionhistory.max_entries - how many URLs you can navigate through using the forward/back buttons
  • network.prefetch-next - whether to prefetch the contents of links on the page

Tab Bar

Firefox 2 made the tab-bar all stupid; here's some setting to make work like it used to:

  • browser.tabs.tabClipWidth = 0
  • browser.tabs.tabMinWidth = 0
  • browser.tabs.closeButtons = 3

To hide the 'all tabs' button (which just wastes space IMO) add the following to chrome/userChrome.css in your firefox profile directory:

 .tabs-alltabs-stack {
   display: none !important;
 }

Theme

Get the firefox 1.5 theme for 2.0 here: https://addons.mozilla.org/en-US/firefox/addon/3479 the 2.0 one is just too ugly to endure...

Vi style bindings

The following instructions are fine evidence that mozilla hates its userbase.

I'm trying to force myself to use vi-style hjkl navigation bindings, but firefox always makes me revert to arrow keys and defeats my resolve. Here's how to fix that:

Find the 'toolkit.js' that your firefox install is using (eg. /usr/local/lib/firefox/chrome/toolkit.jar) and unzip it somewhere. Edit the `content/global/platformHTMLBindings.xml` file and add the following to the 'browser' section:

<handler event="keypress" key="k" command="cmd_scrollLineUp" />
<handler event="keypress" key="j" command="cmd_scrollLineDown" />
<handler event="keypress" key="h" command="cmd_scrollLeft" />
<handler event="keypress" key="l" command="cmd_scrollRight" />

You might also want to disable the arrow navigation buttons. Save the file and zip everything you just extracted back up:

zip -r -0 ../toolkit2.jar .

Then, replace the toolkit.jar with your new one (making a backup is a good idea, probably). Restart firefox and your new key bindings should be live. This is confirmed working with firefox 2.

TODO - figure out how to re-bind the forward/back keyboard shortcuts.

See also: Vimperator - Awesome, but kinda hard to use in reality. Hopefully it will mature.