java callbackks

From: Andrew Harrison <>
Date: Tue, 20 Dec 2005 20:35:08 +0000


I apologise in advance for sending this message to this list because
it's not a PiggyBank question. But there are few places that have as
much expertise with Firefox and Java. And I'm stuck...

So I'm trying to add a JS Object that is invoked from XUL as a
listener to a back-end Java class, in order for the Java class to
send messages into Firefox. The Java class has a method:

void addJSListener(JSObject jsobject);

The JS Object calls on the Javascript-Java 'bridge' component in the
extension to invoke this Java method, giving itself as a parameter
('this'). But when the component arrives in Java it's null - the
JSObject.toString() returns 'null'. If I try and print the JSObject
parameter I get a null pointer exception. If I invoke a method on the
JSObject like eval or call I don't get an exception, but nothing
happens, which is frustrating.

Most of the documentation I can find on JSObject presumes the Java
side object is an Applet, which mine isn't.

So the question is, am I trying to do the impossible (i.e. use
JSObject not from an Applet)? Also I'm using a Mac (with Firefox
1.5)- could this be an issue? Or am I just missing something stupid?

Optimistically thanks in advance,

Received on Tue Dec 20 2005 - 20:27:55 EST

This archive was generated by hypermail 2.3.0 : Thu Aug 09 2012 - 16:39:18 EDT