Solid:JSConsole

From MozillaWiki
Jump to: navigation, search

It would be nice to be able to communicate to a running XUL Application via Eclipse console view.

Implementation ideas

Socket communication

XULRunner should provide a command line option to open a local socket for javascript interaction.

The socket streams could be used in the same way like input and output are displayed/entered in Mozilla's Javascript console window.

Cons: How is the socket secured ? Feature not yet available/planned at XULRunner.

Extend XULRunner console support to support stdin

If you start XULRunner in a shell and use the dump function the output is dumped into the shell.

XULRunner needs to extend to support also stdin to communicate with the running javascript engine.

Pros: The XULRunner console of Eclipse would work out of the box. Interacting with the javascript engine sould work without additional coding.

Users of different development environments (Emacs, VI whatever) could also use this interface to the javascript engine without writing scripts etc.

Keep it simple.

This solution could also replace/integrate the xpcom shell. For example if XULRunner would started without an application argument the application could interact with the user viaa console and would be the perfect javascript shell replacement.

Cons: Axel told me that XULRunner/Mozilla sometimes forks itself multiple times while initializing. This may happen to be a real problem when using stdin.

-> But probably not because stdout works right now (where is difference to using stdin ?).

Communication via (Named) Pipe

It may be also be a solution to communicate to the javascript engine via (named) pipes.