valibuk.net

A place for opinions and notes of a valibuk.

JSSh (Firefox 3.0) with Optional Port Number

Tagged with: — ondrej at 8:15 pm on Sunday, November 9, 2008

One of the ways how to remotely control Firefox is to use the JSSh (JavaScript Shell) plug-in. To successfully install the plug-in, it is necessary to find a suitable version for your Firefox version (1.x, 2.x, 3.x) and platform (Linux, Mac, Win). That is sometimes not so trivial…

Additionally there is a limitation in the plug-in: its communication port number cannot be (easily) changed, so it is not possible to start more JSSh (and Firefox) instances.

First, the actual status is described, later a new version of the JSSh plug-in is provided with examples.

JSSh communication port

The plug-in opens a port on your machine and it listens to commands that are sent to this port. Unfortunately, the port number is fixed and there is no possibility to start more Firefox instances (with different profiles) – except you alter the plug-in source code and replaced the port number value.

Other Attempts

A patched version appeared where it was necessary to say a port number, but the patched plug-in is compatible only with Firefox 2.x and it is not backward compatible, because it makes the port number value mandatory (-jssh vs -jssh number).

A version compatible with Firefox 3.x was created. This version does not contain the patch for changing the port number.

JSSh with Optional Port Number

To make changes in JSSh in a (more) standard way, I submitted a patch to Mozilla. The patch adds an optional parameter -jssh-port number.

The change is backward compatible – it starts on the default port 9997 without the -jssh-port parameter, so your older applications should run without any problems.

JSSh Plug-in with Optional Port Number

And as promised, a new version (0.9.1) of the plug-in that

is available for download (so far only for Linux) here:

I also added a short changelog.txt file that summarizes main versions and web pages of/about this plug-in (again, only for Linux).

A few examples how to use the new option:
i) start FF with JSSh on the default port (9997). This is exactly the previous original way – just to show that everything will work fine also for your current/older scripts.

  1.  

ii) start FF with JSSh on the port 9996:

  1.  

iii) start two FF instances with JSSh on ports 9995 and 9996 (do not forget that it is necessary to use two different profiles):

  1.  

Enjoy :)

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • DZone
  • Digg
  • Reddit
  • Technorati
  • Furl
  • NewsVine
  • Slashdot
  • Ma.gnolia
  • StumbleUpon

8 Comments »

Comment by slava

December 11, 2008 @ 10:18 pm

This does not seem to work for me on Ubuntu 8.10 x64 and firefox 3. I tried installing jssh extention and starting the browser according to instructions, but telnet can’t connect to browser.

~ $ firefox -no-remote -P jssh -jssh
ICEDTEAPLUGIN_DEBUG = (null)
sh: acroread: not found

~ $ telnet localhost 9997
Trying 127.0.0.1…
telnet: Unable to connect to remote host: Connection refused

Comment by matt

March 15, 2009 @ 2:38 am

Same exact problem as the above poster. It seems jssh does not work correctly with ubuntu 8.10 x64.
I’m pretty sure it works on a 32 bit install of ubuntu but not positive of that. This sucks as i was really hoping to get watir (firewatir actually) working on my ubuntu box.

Comment by Thomas Albright

March 24, 2009 @ 10:51 pm

The jssh Firefox Add-On is not officially supported, and not kept up to date. I noticed the one on Watir’s installation page was made in June 2008. I’m sure it won’t work with any 64-bit Firefox, and it pry won’t work with any version of Firefox newer than June 2008.

May I suggest compiling Firefox yourself, with jssh enabled. See here: http://ubuntu-snippets.blogspot.com/2008/07/build-firefox-3-web-browser-with-jssh.html

Comment by ondrej

March 24, 2009 @ 11:32 pm

Slava & Matt: I am sorry, I did not test the add-on/plug-in on a 64bit distro. It worked fine for me on my 32bit system.

Thomas:
not up to date: Unfortunately, you are right. I tried to summarise all versions around to one text file (located in the add-on package).

Firefox newer then June ’08: It worked for me with the newest Firefox in November ’08 (on a 32bit system).

compiling Firefox yourself: It is a way (just takes tens of minutes :). The patch for the jssh port was committed – if you have a version without it, I would suggest to apply the latest patch from the bug 451536.

Comment by bbiker

June 10, 2009 @ 10:23 pm

Do you know if this jssh would work on an iMac with Firefox 3.0.10?

If yes, I would appreciate instructions how to setup (I am newbie)

PS I also use Firefox 3.0.10 and Firewatir 1.6.2 on my Windows XP SP3 machine.
Essentially no problem, except that that I cannot telnet to localhost:997.
This is not a show stopper for me.

Thank you for any assistance you may provide.

Comment by Stanley

March 12, 2010 @ 11:47 pm

I’ve written an updated guide for setting up Firefox with JSSH support on Ubuntu 64bit: How to build Firefox 3.5+ with JSSH on Ubuntu 9.10 64bit
It should work for all Firefox versions up to 3.7a.

Hope this helps some of you.

Comment by ondrej

March 15, 2010 @ 1:42 am

@stanley: thank you

Comment by Robert James Fetter

May 10, 2011 @ 11:47 pm

Are there any thoughts on supporting Firefox 4.0.1 ?

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Comment Preview


commercial break :)

Make an account on slicehost.com -- a really good hosting where you have your own virtual machine. I installed Gentoo there = I like it very much ;)