On Jul 20, 2012, at 1:21 PM, mike cupcake wrote:

> On Friday, July 20, 2012 7:20:52 PM UTC+1, Hans Henrik Bergan wrote:
> if(java.net.InetAddress.getLocalHost().getHostAddress().toString().match(/$192.168/)
> {
> throw "stopping script";
> }
> 
> isn't that Java, not Javascript?  I don't believe Javascript can access the 
> machine's IP address directly.

Exactly. If there's a service available on the OP's corporate LAN that will 
return his machine's LAN IP address, then he can use that info to bail out of 
the script.

Another approach would be to make a request to any service that is available 
only on the private network. If the request succeeds, bail out of the script, 
because you're on the LAN. This might require some fancier coding because the 
request to the LAN-based service would constitute XSS from the perspective of 
whatever page is being loaded by the browser.

Otherwise, there's no known way that I can discover for JavaScript within a 
browser to return the local machine's IP address.

Dave

-- 
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.

Reply via email to