Compare Revisions

Java in Firefox Extensions

Change Revisions

Revision 138792:

Revision 138792 by Brettz9 on

Revision 138793:

Revision 138793 by ignisvulpis on

Title:
Java in Firefox Extensions
Java in Firefox Extensions
Slug:
Talk:Java_in_Firefox_Extensions
Talk:Java_in_Firefox_Extensions
Content:

Revision 138792
Revision 138793
n23      <br>n23      &nbsp;
nn30    <p>
31      &nbsp;
32    </p>
nn34<span class="kwd">var</span><span class="pln"> urlClasz </span><s
 >pan class="pun">=</span><span class="pln"> java</span><span class
 >="pun">.</span><span class="pln">lang</span><span class="pun">.</
 >span><span class="typ">Class</span><span class="pun">.</span><spa
 >n class="pln">forName</span><span class="pun">(</span><span class
 >="str">"java.net.URL"</span><span class="pun">);</span><span clas
 >s="pln"><br></span><span class="kwd">var</span><span class="pln">
 > urlArray </span><span class="pun">=</span><span class="pln"> jav
 >a</span><span class="pun">.</span><span class="pln">lang</span><s
 >pan class="pun">.</span><span class="pln">reflect</span><span cla
 >ss="pun">.</span><span class="typ">Array</span><span class="pun">
 >.</span><span class="pln">newInstance</span><span class="pun">(</
 >span><span class="pln">urlClasz</span><span class="pun">,</span><
 >span class="lit">1</span><span class="pun">);</span><span class="
 >pln"><br></span><span class="pln">urlArray[0] = </span><span>new 
 >java.net.URL('<a class="external" href="http://foo.net/bar.jar" r
 >el="freelink">http://foo.net/bar.jar</a>'</span><span>);<br></spa
 >n>var cl = new java.net.URLClassLoader(<span class="pln">urlArray
 >);  // java script array conversion to java array conversion does
 > not work with the new plugin2.</span>
31<code>var cl = new java.net.URLClassLoader(35//var cl = new java.net.URLClassLoader(
32    [ new java.net.URL('http://foo.net/bar.jar') ]36//    <span style="background-color: rgb(255, 0, 0);">[ new java.
 >net.URL('http://foo.net/bar.jar') ]</span>
33);37//);
n37</code>n
nn45    <p>
46      &nbsp;
47    </p>
n43<code>var reflect = java.lang.reflect;n49var reflect = java.lang.reflect;
n50</code>n
t59      <s>I also needed a .java.policy file added to the user homet64      <strike>I also needed a .java.policy file added to the user
> directory to give privileges to my jars.</s> (I found I could al> home directory to give privileges to my jars.</strike> (I found 
>so use the code and technique used in the <a href="en/Java_Firefo>I could also use the code and technique used in the <a href="/en/
>x_Extension">Java Firefox Extension</a> with its firefoxClassLoad>Java_in_Firefox_Extensions" title="en/Java_in_Firefox_Extensions"
>er JAR, being sure to load this JAR and my own only once at the s>>Java Firefox Extension</a> with its firefoxClassLoader JAR, bein
>tartup of the extension) (To get DLL's to work, I needed to add t>g sure to load this JAR and my own only once at the startup of th
>hem to the /components directory with an .autoreg file or to the >e extension) (To get DLL's to work, I needed to add them to the /
>Program Files\Mozilla Firefox files. When files were created, the>components directory with an .autoreg file or to the Program File
>y were added to that folder as well.>s\Mozilla Firefox files. When files were created, they were added
 > to that folder as well.

Back to History