Mozilla / SeaMonkey Hacking: Adding a FireFox-like FindBar
The goal of this mini-project is to add a FireFox-like FindBar to Mozilla 1.7.x and SeaMonkey 1.0.
This requires a minimal change
to a core-jar file (comm.jar) - the rest can be done by installing an extension.
I guess I'll call it Find-Bar (or Content-Search-Bar ?).
The nice thing is that the jar files are just ZIP archives, so that the modification
can be done with ANY Mozilla / SeaMonkey installation, even those installed
from deb or rpm packages.
Here is a screenshot:
In order to place the FindBar at the bottom of the window, just above the status bar,
we need to modify one JAR archive:
Make a copy of MOZILLA-SEAMONKEY/chrome/comm.jar, unzip it and find the file
chrome/comm.jar/content/navigator/navigator.xul
and add
<toolbox id="extensions-toolbox">
</toolbox>
between
<hbox flex="1">
<vbox id="sidebar-box" class="chromeclass-extrachrome"/>
<splitter id="sidebar-splitter" class="chromeclass-extrachrome" />
[...]
</vbox>
</hbox>
and
<statusbar id="status-bar"
Zip the chrome again as comm.jar. On Linux do so with:
$ zip -r comm.jar content
Make sure you backup the original comm.jar file and now replace MOZILLA-SEAMONKEY/chrome/comm.jar
with the newly generated JAR archive.
That's it! That was the only modification to the browser itself to add a hook for the FindBar.
Now install the extension (tested with SeaMonkey 1.0 and Mozilla 1.7.8):
Download seamonkey-findbar.xpi (20k) (right-click, save-as and open with Mozilla/SeaMonkey)
Download seamonkey-findbar.tar.gz source code (50k)
Restart your browser and press CTRL-f. The FindBar pops up like in FireFox.
Keyboard shortcuts:
CTRL-f open the FindBar
Escape close the FindBar
ALT-n next match
ALT-p previous match
ALT-a highlight all matches
ALT-c toggle case sensitivity
This is also a fine template / tutorial for making
extensions for Mozilla / SeaMonkey with a locale directory and a skin/css/images directory.
USE AT YOUR OWN RISK!!!
Last-Modified: Mon, 20 Feb 2006 13:39:50 GMT