Hmm, perhaps what they were doing was running an applet within the web page. >From an applet there is some ability to communicate between the java code (the applet) and javascript. I'm no expert at it, but I have seen the examples or read about it somewhere along the way.
That's my best guess to explain what you mean by someone managing firefox from within a Java environment. To be clear about things, Firefox uses Seamonkey as its javascript engine, it doesn't even use Rhino. However, if you just go pick up a copy of the open source Seamonkey engine you'll be in exactly the same position you are in with Rhino. You'll have a piece of software that can execute javascript code, but does not have any interfaces with a browser. Perhaps it will help to highlight the difference between a javascript engine and a browsers DOM. Javascript is a generic language that has uses outside of the web browsers (though its use in web browsers is more common by a very large margin). Rhino and Seamonkey are javascript engines, that is, they run javascript code. In the same way that a perl engine runs perl scripts. The DOM (Document Object Model) is a set of functions and attributes provided by the browsers to allow you to control objects in the web page. The DOM can be (and is) implemented in multiple languages (for example IE allows you to access DOM objects using VBScript as well as Javascript). So even if you took a JavaScript engine like Seamonkey, if it were executing outside of Firefox it would not have access to any of DOM objects that firefox makes available when Firefox is executing the javascript (e.g. the javascript is embedded in the web page). On a side note, both firefox and IE have some external APIs that do allow you some external control over the browser, but those APIs don't have anything special to do with Javascript, nor am I any expert on them. Hope that helps more now. David -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] a.org] On Behalf Of [EMAIL PROTECTED] Sent: Monday, November 24, 2008 2:01 PM To: [email protected] Subject: Re: How to communicate with Firefox in Java Hi David, Thank for you answer. And yes i try to control my firefox with javascript in java. Previous group of students try to do this with rhino but it doesn't work. I don't know if it work or if they try to mystify to the professor wtih false code. So you say that in java launching javascript by rhino, we can't do something with firefox like change url page ? I have a project where i need to change the current page with Java. I try to do this with what previous students have done. So i need to know if it is possible or not and to explain to my professor that it's not possible by the way that have done by previous student. PP. P.S : Excuse my english, i don't know if you understand me but thank you for your answer. Don't hesitate to ask me to explain part of what i wrote. _______________________________________________ dev-tech-js-engine-rhino mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino _______________________________________________ dev-tech-js-engine-rhino mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino
