Documente Academic
Documente Profesional
Documente Cultură
http://www.computerworld.com/action/article.do?command=printArticle...
1 de 7
30/5/2007 12:25
http://www.computerworld.com/action/article.do?command=printArticle...
Hacking Firefox
2 de 7
30/5/2007 12:25
http://www.computerworld.com/action/article.do?command=printArticle...
Hacking Firefox
If you are more inclined to wait for a page to finish loading before attempting to do anything with it (like scroll
through it), you can set content.max.tokenizing.time to a higher value and content.switch.threshold to a
lower value to allow Firefox to finish rendering a page faster at the expense of processing user commands.
On the other hand, if you're the kind of person who likes to scroll through a page and start reading it before
it's done loading, you can set content.max.tokenizing.time to a lower value and content.switch.threshold
to a higher one, to give you back that much more responsiveness at the cost of page-rendering speed.
Have tabbed browsing your way
Right from the start, one of Firefox's strengths has been tabbed browsing. But if the tabs don't behave quite
the way you want them to by default, or you hate the way the default behaviors have changed since Firefox
1.x, the following changes will bring them in line.
Corral close buttons
The integer preference browser.tabs.closeButtons controls how the close buttons (the "X" icons) are
rendered on tabs:
0: Display a close button only on the currently active tab. This is a nice way to keep from accidentally
smacking into a close button for the wrong tab.
(You can press Ctrl-F4 to close only the current tab, but many mouse-centric people never bother to
do this.)
1: Display close buttons on all tabs (default).
2: Don't display any close buttons; the only way to close a tab is by pressing Ctrl-F4.
3 de 7
30/5/2007 12:25
http://www.computerworld.com/action/article.do?command=printArticle...
3: Display one close button at the end of the tab bar (Firefox 1.x's default).
Hacking Firefox
The tab bar before and after reducing the minimum tab width. (Click for larger view.)
In the same vein, the integer preference browser.tabs.tabClipWidth sets the minimum width, in pixels, that
a tab must be in order to show a close button. This is 140 by default, so if you set this to something lower,
you'll see more tabs with close buttons when the tab bar is heavily populated.
Make the user interface behave
Another big reason people hack Firefox's settings is to modify the user interface -- either to make it a little
easier to do something, or to revert to a behavior that was prevalent in Version 1.x but changed in 2.0.
Get case-sensitive, in-page searches
The integer preference accessibility.typeaheadfind.casesensitive controls how Firefox's "Find as You
Type" feature behaves. The default is 0 for case-insensitive searches; set it to 1 for case-sensitive matching.
Control address bar searches
You may have noticed that if you type something into Firefox's address bar that's not an address (a
"keyword"), Firefox typically passes it on to Google as an "I'm Feeling Lucky" search term. The exact search
engine string to use is defined in the string preference keyword.URL; if you want to change it to something
else, you can simply edit this string.
For instance, to make Microsoft's Live.com the default keyword search, set this string to
http://search.live.com/results.aspx?q=
For a Yahoo search, it would be
http://search.yahoo.com/search?p=
If you want to restore the default search, use
http://www.google.com/search?ie=UTF-8&oe=
4 de 7
30/5/2007 12:25
http://www.computerworld.com/action/article.do?command=printArticle...
UTF-8&sourceid=navclient&gfns=1&q=
Finally, if you want to turn this address-bar keyword functionality off altogether, set the Boolean preference
keyword.enabled to false.
Note that with Google, the more generic the keyword, the less likely it is to be used as an "I'm Feeling
Lucky" search -- although what constitutes "generic" isn't always clear. For instance, typing "clean" into the
address bar returns a generic Google search page, but "sideways" takes me to the Internet Movie Database
entry for the movie of that name (the "I'm Feeling Lucky" result). Your mileage will almost certainly vary.
Select just a word
The Boolean preference layout.word_select.eat_space_to_next_word governs one of Firefox's tiny, but
for me incredibly annoying, little behaviors. When you double-click on a word in a Web page to select it,
Firefox automatically includes the space after the word. Most of the time I don't want that; I just want the
selection to stop at the end of the word. Setting this to false will defeat that behavior.
Select a word and its punctuation
Somewhat contrarily, if you double-click a word that's next to any kind of punctuation mark, Firefox defaults
to selecting only the word itself, not its adjacent punctuation. Set the Boolean preference
layout.word_select.stop_at_punctuation to false to select the word and its adjacent punctuation.
Get Alt-hotkey shortcuts back
One minor change in Firefox 2 was the way in which form elements on a Web page had hotkey bindings
assigned to them. In Firefox 1.x, when a Web page assigned a hotkey to a form element, you pressed
Alt-hotkey to access it. In Version 2.x, this was changed to Alt-Shift-hotkey. To revert to the original 1.x
behavior, set the integer preference ui.key.contentAccess to 4. This is useful if you have, for instance, a
Web-based interface you spend a lot of time in, and use Alt-key bindings to do things quickly in that
particular page.
Hacking Firefox
Note that one possible consequence of setting this back to the old
behavior is that Alt-key bindings on a Web page can now override
the default key sequences for the program itself (such as Alt-S for
History), but you can always get around this by tapping Alt to
activate the menu and then tapping the program hotkey in
question.
5 de 7
30/5/2007 12:25
http://www.computerworld.com/action/article.do?command=printArticle...
connections Firefox makes to the same server, which allows multiple elements in a page to be downloaded
in parallel. Normally, this is set to 8, but some people choose to set it as high as 16.
Note, however, that some Web servers will block you if you try to establish more than 8 inbound
connections, typically as a bandwidth-protection or antileeching measure -- this is the kind of behavior also
exhibited by download managers that try to use as many "slots" as possible to speed things up, and many
server admins hate that sort of thing. Also, if you're on a connection that's not fast to begin with (e.g., slow
ISDN or dial-up), changing this setting will have no discernible effect, and may in fact slow things down.
Bump up persistent connections per server
Firefox keeps persistent connections to a server "alive" to improve performance: Instead of simply sending
the results of one request and then closing, they're held open so that multiple requests can pass back and
forth. This means a little less network traffic overall, since a connection to a given server has to be set up
only once, instead of once for each separate piece of content; it also means successive connections to the
same server go through faster.
The integer preference network.http.max-persistent-connections-per-server controls the number of
persistent connections allowed per server. By default, this is set to 2, although some servers will honor a
higher number of persistent connections (for instance, if there's a lot of content from their site that loads in
parallel, like images or the contents of frames). You probably only want to go as high as 8 with this; more
than that may cause a server to temporarily blacklist your IP address depending on how it's configured. (If
you're going through a proxy defined by Firefox, use network.http.max-persistent-connections-per-proxy
instead of this setting.)
Hacking Firefox
Most people set this to 0 (in seconds), with the default being 10.
Note that this does not override connection limits imposed by
remote hosts, so its usefulness is limited by the whim of the server you're connecting to.
Turn on pipelining
The Boolean preference network.http.pipelining enables an experimental acceleration technique called
"pipelining," which speeds up the loading of most Web pages. A browser normally waits for some
acknowledgment of a given request from a server before attempting to send another one to that server;
pipelining sends multiple requests at once without waiting for responses one at a time.
If you turn this on (that is, set its value to true), also be sure to create or edit the integer preference
network.http.pipelining.maxrequests, which controls the maximum number of requests that can be
pipelined at once. 16 should do it; some people go as high as 128 but there's not much evidence it'll help. (If
you use a proxy, set network.http.proxy.pipelining to true as well.)
Note that not every Web server honors pipelining requests correctly, which is why this feature is turned off
by default and still considered experimental. Some sites may behave strangely if you submit pipelined
requests.
Stop memory hogging
The default way the Windows version of Firefox consumes memory can be alarming if you don't know what's
really going on. People routinely report a memory "footprint" of 75MB to 100MB or more with only a few
windows or tabs open, and they assume a memory leak is to blame. While earlier versions of Firefox did
have memory leak bugs, they're not the reason for this kind of memory consumption in Firefox 2.x.
Here's what's happening: Firefox caches recently used objects -- Web pages, images -- in memory so that
they can be re-rendered on-screen quickly, which drives up memory usage. The following tweaks can make
Firefox stake out memory less aggressively. (Note, however, that lightening the memory load might make
your pages load a bit more slowly than you're used to.)
Reduce graphics caching
When the Boolean preference browser.cache.memory.enable is enabled (the default), Firefox keeps
copies of all graphical elements from the current browsing session in memory for faster rendering. You can
set this to false to free up more memory, but pages in your history will reload less quickly when you revisit
them.
Another option: Set the value to true and create a new integer preference called
browser.cache.memory.capacity. Then specify, in kilobytes, how much memory to set aside for graphics
caching. That way you get some of the speed benefits that graphics caching provides without taking a huge
6 de 7
30/5/2007 12:25
http://www.computerworld.com/action/article.do?command=printArticle...
memory hit. If you use -1 as the memory value, Firefox will size the memory cache based on how much
physical RAM is present.
Reduce Web page caching
Firefox caches several recently visited Web pages in memory so they don't have to be regenerated when
you press Back or Forward. The integer setting browser.sessionhistory.max_total_viewers determines
how many individual Web pages to store in the back/forward cache; each page takes about 4MB (or
4,000KB) of RAM.
By default, however, this value is set to -1, which determines how many pages to cache from the amount of
available physical memory; the maximum number of pages stored when you use -1 is 8. Set this value to 0
to disable page caching entirely. That will save some memory, but will also cause Back and Forward
navigation to slow down a bit.
Note that this caching is not the same as browser.cache.memory.enable: That setting is for rendering
elements on pages like graphics and buttons, and the contents of https-encoded pages, while this setting is
for caching the text content of Web pages that have already been rendered or "tokenized."
Hacking Firefox
7 de 7
30/5/2007 12:25