Hi Andrea,
It turns out that Firefox support interaction between java and javascript.
Now I found the solution of you problem is to add js into web page, sample
as below:
var body = document.body;
var ip = document.createElement('script');
ip.setAttribute('type','text/javascript');
ip.innerHTML = 'var ip = new java.net.InetAddress.getLocalHost();alert(ip);'
body.insertBefore(ip,body.firstChild);
Hope it helps!
2008/9/2 [EMAIL PROTECTED] <[EMAIL PROTECTED]>
>
> Hi Neng,
>
> I really don't know if I'm doing something wrong, but
> from the js console provided by firebug and with a java-plugin
> installed, i'm able to run the statment I report in my original post.
> to get more info see:
>
>
> http://developer.mozilla.org/index.php?title=En/Java_in_Firefox_Extensions&highlight=java
>
> as far as i understand from a firefox extension you can execute java
> code...
>
> but as I just said I'm totally newbie both in the js and gm world so i
> really don't know what's
> the magic that makes me able to run java code from the js console
> provided by firebug.
>
> anyway, are you aware of a way to get my local IP address within a GM
> script ?
>
> thanks
> andrea
>
>
> On Tue, Sep 2, 2008 at 11:18 AM, Neng Wang <[EMAIL PROTECTED]> wrote:
> > It seems no way to get access to java in javascript code
> >
> > 2008/9/1 [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> >>
> >> Hi all,
> >>
> >> in javascript console I'm able to run something like:
> >>
> >> var
> >> ip=java.net.Socket("192.168.0.4
> ",80).getLocalAddress().getHostAddress();
> >>
> >> to get my local IP address (that's the only way that I'm aware
> >> to get this info, excluding php/ssi/flash). Anyway this statement fails
> >> when executed inside a gm script. the raised error message
> >> is "java is not defined".
> >>
> >> is there a way to get access to java functionality inside a gm script?
> >> or alternatively a way to get my local IP address?
> >>
> >> thank you
> >> Andrea
> >>
> >>
> >
> >
> >
> > --
> > Neng Wang
> >
> > >
> >
>
> >
>
--
Neng Wang
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"greasemonkey-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/greasemonkey-users?hl=en
-~----------~----~----~----~------~----~------~--~---