No, not the Java SSH library. JSSh is a promising-looking cross-platform plugin for the Mozilla family of browsers that lets us script a browser over a network socket.
The way it works is that you install the .xpi file (the plugin), launch the browser with the "-jssh" option, and start sending commands to port 9997. Sounds like the automator's wet dream? It sure does... But it's not that simple.
You see, some weeks ago I was trying to get that damn .xpi file installed on my Fedora laptop for 15 minutes and it just wouldn't happen. I could download the file alright, but when I tried to actually install it, Firefox said something about not finding the file. Later on, I figured out that I needed to use Mozilla--the "real" Mozilla--and not Firefox.
Bang.
Plugin installed.
Bang.
Browser launched with the "-jssh" option.
Somebody's listening on port 9997.
Can this be true?
Of course not.
[lkoskela@kera ~]$ telnet localhost 9997
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
JSSh server: new connection!
###!!! ASSERTION: failed to get script security manager: 'Error', file /home/alex/devel/mozilla-trees/clean/mozilla/extensions/jssh/nsJSSh.cpp, line 567
Break: at file /home/alex/devel/mozilla-trees/clean/mozilla/extensions/jssh/nsJSSh.cpp, line 567
Welcome to the Mozilla JavaScript Shell!
> print("hello")
Connection closed by foreign host.
[1]+ Segmentation fault mozilla -jssh
As I said, this was a few weeks ago and the need is no longer that urgent but if you've gotten this to work and have documented your setup somewhere online, I'd love a pointer.
Having said that, I am aware of the disclaimers about JSSh depending on unfrozen Mozilla APIs which might change from one version to another ("WARNING: As JSSh uses unfrozen Mozilla APIs there is quite a big chance that these XPIs will not work in a particular Mozilla release."). What I'm basically looking for is rumors of which versions of which have been proven to work...
Where can that be found? The jSSH link leads to a page that makes oblique references to getting source code from CVS; no mention of an xpi file.








It works with Mozilla 1.8b -
http://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/mozilla1.8b1/
Sample run -
[jain@ps2913 jain]$ telnet localhost 9976
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Welcome to the Mozilla JavaScript Shell!
> 5+5
10
> help(getWindows)
getWindows() returns a list of all currently open windows
> var w0 = getWindows()[0]
1
> var w0 = getWindows()[0]
2
..
..
> browser.loadURI(<some URL>) -> even this worked
Pls try it and let me know if you have any issue.
Now the next thing is how can we extend this for auto web application testing? Pls let me know If you have any suggestion on this.
Thanks,
cp