2005-11-22
How to fiddle with Firefox .jar files relatively easily
A lot of Firefox's code is actually written in various interpreted languages, especially JavaScript, and Firefox extensions are pretty much all interpreted. This means that you can do a lot of Firefox and extension hacking without ever having to rebuild from source; you just zap the interpreted files in place in your installed copy.
Firefox doesn't leave all of these files sitting around for you to
edit; it bundles them up in various .jar
files (pretty much all in
the chrome/
subdirectory). Fortunately .jar
files are just ZIP
archives. The easy way to modify files in them is:
- unzip the relevant jarfile somewhere (I usually use
chrome/
itself, but I live dangerously) - edit the unpacked files to taste
- run '
zip -f .../<whatever>.jar
' in the root of where you unpacked the jarfile to 'freshen' it with your changes - restart Firefox to test things.
(There are recipes for running Firefox from unpacked versions of the
.jar
files, but they require some black magic.)
(Figuring out which is the relevant jarfile (and the relevant source files) is beyond the scope of this entry; I suggest unpacking jarfiles and poking around. Also, see the Mozilla knowledge base at http://kb.mozillazine.org/.)