This is a Firefox extension that demonstrates how you can use Java inside a Firefox extension. We have used this technique in our Piggy Bank extension. This extension distills the technique to a skeleton so that you can more easily comprehend.
This is intended for Firefox extension developers only.
You can browse the code online or you can follow these steps to download and build it yourself.
Here is a list of things you need to build Java Firefox Extension:
How to build it:
cd where/you/want/it
svn checkout http://simile.mit.edu/repository/java-firefox-extension/ java-firefox-extension
cd java-firefox-extension
ant
This will create a distribution in the ./dist
directory that
contains everything and a packaged version java-firefox-extension-[version].xpi
in the same folder. This XPI package
is a zip package that is recognized by firefox as an extension.
For some tips on extension development, refer to Developers' Guide for Piggy Bank.
Once you install the extension in Firefox (and restart Firefox), you can open up Firefox's JavaScript console (from the Tools menu) and see the extension's messages:
FooComponent.initialize { FooComponent._bootstrapClassLoader { } FooComponent._bootstrapClassLoader FooComponent._loadJava { } FooComponent._loadJava Greetings: Hello World! } FooComponent.initializeThis tells you that the extension has been successful at loading its own Java code. Then you can try to invoke Firefox's menu Tools → Java Firefox Extension: Do It!. You should get a dialog box displaying 43. Subsequent invocations increment that number.
These are some steps enough for you to start exploring the code:
Java Firefox Extension is open source software and is licensed under the BSD license.
This software is maintained by the SIMILE project and in particular: