Getting full permissions for LiveConnect Java without needing a .java.policy file

Brett Zamir <[email protected]> Wed, 12 Dec 2007 13:21:45 +0800
Newsgroups gmane.comp.mozilla.devel.java
Message-ID <475F6FE9.8080907__24786.1246964478$1197436961$gmane$org@yahoo.com>
Hello,

I've just updated an extension called XqUSEme at 
https://addons.mozilla.org/en-US/firefox/addon/5515 to use the open 
source Saxonica XQuery engine, avoiding the previous requirement for a 
separate download (of the hefty Berkeley DB XML native XML database) and 
included all of the files necessary without need for manually editing 
files, etc., so the W3C standard XQuery language is now available in 
Firefox via this extension.

The reason I bring this up is that, although this might be already be 
obvious to some of you, in the process of doing this, I discovered, that 
I could borrow and adapt just a small portion of the "Java Firefox 
Extension" code (BSD license) to give all permissions to my extension 
without needing to set up an XPCOM component, though due to try-catch 
not being fully supported in Firefox LiveConnect apparently, I needed to 
make wrapper classes invoked via a URLClassLoader (or via forName if the 
JAR was in the /components directory?) to catch errors within Java.

Anyone is welcome to take a look at the source of the extension if it 
might help, and ask any questions about how to apply the technique to 
your own use of Java (I'm a newbie to Java, but with some help, I was 
able to figure out how to get the basics working).

best wishes,
Brett