I wrote about
: -
http://groups.google.com/group/comp....8f34311e797e79
> > Daniel's post shows up as 25/9/2008 so there's every chance that it's
state
> > of the art. Does anyone have any better/other/more-integrated ideas?
Daniel Pitts wrote: -
> It was state-of-the-art when I posted it. Since then, I've also run into
> what appears to be threading issues causing firefox to crash :-( It's
> unfortunate because every other aspect of our tool was targeting firefox.
In case it helps anyone, an alternative to Daniel's method of bypassing the
FF bug with JSObjects is simply to pass the JSObject into a Javascript
function and return it straight back as in: -
Tier3Client.launder =
function(jsobject) {
return jsobject;
}
8<-------------------
public int sendMessage (JSObject msgBuf,
String msgIn,
int windowSlotId)
throws IOException,
Tier3ClientException
{
System.out.println("In Session sendmessage");
WindowSlot windowSlot = getWindowSlot(windowSlotId);
rinseArgs[0] = msgBuf;
try {
cleanBuf = (JSObject)windowSlot.namespace.call("launder",
rinseArgs);
}
catch (Exception e) {
throw new Tier3ClientException("Unable to launder Message
Buffer", e);
}
Even though Internet Explorer doesn't suffer from the same bug as FireFox,
the work around is valid for both so, in this case, I haven't bothered to
conditionalize the code. IIRC Daniel's example didn't work on IE?
Obviously you could create the "launder" function on the fly with a unique
name via eval() rather than use a predefined static function.
At least one other thing about FF that I find annoying is that when
JSObject.call() fails it does so silently. I'm toying with the idea of
CALLing another static "dispatch" function and have Javascript to the
apply()/call(). Anyone suffering from conviction one way or the other?
Regards Richard Maher