I am developing a web browser in java. For parsing and rendering I am using cobra 0.98.4 .
cobra is not cookie enabled . So to save cookie I create a cookie management class. I can extract cookie from a web page . But I don’t know how to send it. I know that to send cookie I have to set property of URL-Connection and create an URL-connection. Because different website use java-script button for log-in.My main problem is that I can not listen a java-script event . How can I listen a java-script event in java ? I need to know the button event to create an connection to server to send the cookie that was extracted from the last page.
I am developing a web browser in java. For parsing and rendering I am
Share
You say you are developing a new browser? what do you use for javascript compiler? you know, like IE has jscript mozilla has .. something else, can’t remember right now. Anyhow in order to create an event listener you will need some kind of hook method something like:
if (myButton.onClick && typeOf(myButton.onClick) == “function”){ // on click event is attached
if (!myButton.onClick(event)){
break;
}
}
I mean if you truly developing a new browser you should have a place where you already defined the ‘click’ event in order to do some kind of animation or even postbacks or so and there would be the place to define a “hook” method.