On 6/15/06, Lian Liming <lianliming@xxxxxxxxx> wrote:
So I wonder there is a possibility to hook up the JS debugger provided by ATF when using external XULRunner to launch XUL applications.
As Adam explained in another post, this is not possible at the moment. JavaXPCOM can currently only be used for starting and communicating with an embedded browser. While I have been working on a solution to attach to a running XULRunner instance, this work is slow going at the moment, so I wouldn't count on it any time soon.
> I have another approach in addition. Maybe we can use JavaXPCOM to create and run an xul window. I have seen some JavaXPCOM code snippets as following...
> Sorry to make thing misunderstand, I just copy that snippet from the online article
http://rayh.co.uk/blog/?p=13 . There it has more detail explanation.
First, thanks for pointing us to that post.
Secondly, I think he's on to something. In essence, you would have to create your own SWT widget class that embeds XULRunner. In particular, you would have to provide your own LocationProvider (as Ray mentions) in order to point XULRunner at the correct directories. After that, if XRE startup does anything special, you may need to mimic those in Java.
With that, it seems to me like it should work. You just can't use the org.eclipse.atf.mozilla.swt.browser project. That is, you would have to modify significant portions of the startup code, but you could probably reuse much of the SWT-interaction code.
Hope all that makes sense...
Javier Pedemonte
ATF Developer