Is it possible to process JavaScript in a Java application? Possibly utilizing WebKit libraries, or whatever browser libraries use to process JavaScript? A use case would be - how, in Java, can I determine the possible links this web page would go to?
<script>
function goToLink(){
if(1==1){
window.location='www.somesite.com'
} else {
window.location='www.nevergethere.com'
}
}
</script>
<html>
<a href onClick='javascript:goToLink()'>CLICK HERE!!</a>
</html>
Typically, you would just search all of the code for a link regular expression, but you will never actually have the chance of going to: 'www.nevergetthere.com'