Hi, Adam
I assume from your comments that EclipseXUL launches Mozilla as a
separate process? (Do they really use xulrunner? Do they
embed it in Java or some other executable?)
Yes,
your assumption is right. In commandline, you can easily launch the XUL
application by the command: "<PathToXULRunnerExecutable>/xulrunner <PathToXULProject>/application.ini".
In EclipseXUL's run/debug mode, it composites up the command and then
invoke it from Java codes to start the XUL application. So EclipseXUL
launches mozilla as a separate process.
In order to talk to
that external instance of xulrunner, we'd need to use some interprocess
communication mechanism. Javier Pedemonte has proposed using a
Java component loader such that the external instance of Mozilla would
launch a small Java process within it, and then you could talk to it
over RMI. He went further to suggest wrapping RMI around his
XPCOM bridge so this could be relatively transparent.
Is
this way using RMI for interprocess communication in mozilla still in
proposal stage? Or is there any working examples showing how to do this
in detail?
Another approach might be to get the embedded browser (xulrunner) to be
more chrome- and XUL- aware. xulrunner doesn't seem to be able to
do this by default, but bsmedberg implied that it ought to be possible,
perhaps a matter of configuration? I don't understand the details.
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:
<snippet>
..............
windowWatcher.setWindowCreator(windowCreator);
nsIDOMWindow win = windowWatcher.openWindow(null, "chrome://your-app/content/window.xul", "mywindow", "chrome,resizable,centerscreen", null);
appShell.run();
........
</snippet>
If we could run xul page through JavaXPCOM, we don't need to use interprocess
communication mechanism.
I don't know much detail about JavaXPCOM, so I wonder if this is a right direction. Any suggestion?
Regrads,