This is cool ...
JSSh - a TCP/IP JavaScript Shell Server for Mozilla
JSSh is a Mozilla C++ extension module that allows other programs (such as telnet) to establish JavaScript shell connections to a running Mozilla process via TCP/IP. This functionality is useful for interactive debugging/development of Mozilla applications, remotely controlling Mozilla, or for automated testing purposes.
http://www.croczilla.com/jssh