Stanley Shilov

How to build Firefox 3.5+ with JSSH on Ubuntu 9.10 64bit

Posted on Thursday, February 4th, 2010 under Coding, Software

I needed to run Firefox with JSSH support on Ubuntu 9.10 x64 in order to use it with Ruby’s Watir library. Unfortunately the xpi file available on the watir site does not support 64bit Ubuntu, which meant I had to compile Firefox from scratch with builtin support for JSSH.

The configuration file (.mozconfig) has changed slightly with the newer versions of Firefox, so the older guides out there no longer work. Below is an updated step by step process which works up to Firefox 3.7a1pre (the newest version available at the time of this writing). Needless to say, this should also work with Firefox 3.5 and 3.6.

Build all the necessary packages to compile Firefox:

sudo apt-get build-dep firefox

Mozilla has switched from CVS to mercurial for source code management. Install mercurial and fetch the source:

sudo apt-get install mercurial
hg clone http://hg.mozilla.org/mozilla-central/ mozilla

The above will retrieve the latest version of Minefield. If you want use 3.6 or 3.5, check out this Mozilla wiki.

Once the source is done downloading, cd into mozilla and create the .mozconfig file:

cd mozilla
vim .mozconfig
# .mozconfig:
mk_add_options MOZ_CO_PROJECT=browser
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/firefox-jssh
ac_add_options --enable-extensions=default,jssh
ac_add_options --enable-application=browser
ac_add_options --enable-webservices
ac_add_options --disable-libnotify
ac_add_options --disable-necko-wifi

The last two lines are optional. It might be because I’m using awesome, but the source wouldn’t compile for me without those last two lines.

Save the file and run make:

make -f client.mk build

It’ll take a few minutes but once it’s done you can launch Firefox by running:

./firefox-jssh/dist/bin/firefox -jssh

Keep in mind, this is separate from any existing Firefox installation you might have already had.
I would recommend creating a separate Firefox profile to use for this installation.

If you’re doing this to get Watir running, you can test it out with this simple script:

require 'rubygems'
require 'firewatir'

fx = FireWatir::Firefox.new
fx.goto("http://www.whatismyreferrer.com");

It should open a new window and change the URL to http://www.whatismyreferrer.com

That’s about it. Hope this helps a few of you.

Possible Errors and Solutions

checking for GL/glx.h... no
configure: error: Can't find header GL/glx.h for WebGL (install mesa-common-dev (Ubuntu), mesa-libGL-devel (Fedora), or Mesa (SuSE))
*** Fix above errors and then restart with               "make -f client.mk build"

Install the package appropriate for your distro and you’ll be good to go.

You can leave a response, or trackback from your own site.
  1. Josh Moore Says:

    Thanks for the write up! This helped me a lot to get firefox working with JSSH

  2. LeewardBound Says:

    Very helpful! Thanks for the write up! Many props! I will now take over the interweb!

  3. Colin Says:

    hi -

    Problem – successfully installed originally but now when trying to run

    /firefox-jssh/dist/bin/firefox-bin -jssh

    I get the message:

    error while loading shared libraries: libxul.so: cannot open shared object file: No such file or directory

    Any idea how to resolve?

    Thanks
    Colin

  4. William Says:

    @Colin:

    You might try changing this line in .mozconfig:

    mk_add_options MOZ_CO_PROJECT=browser

    to this:

    mk_add_options MOZ_CO_PROJECT=browser,xulrunner

  5. William Says:

    @Colin:

    Nevermind, I got the same error. Fixed it by changing LD_LIBRARY_PATH:
    LD_LIBRARY_PATH=”$PWD/firefox-jssh/dist/lib/:/usr/lib/:/lib” firefox-jssh/dist/bin/firefox-bin -jssh

  6. Jon Says:

    I ran into this issue today trying to get Watir working on Ubuntu 10.04 x86_64. Before I started ripping Firefox apart I happened to come across a much easier solution… at least for me. It uses two modules, selenium-webdriver and watir-webdriver. I haven’t looked too much into the technicalities yet but it seems that selenium-webdriver provides it’s own version of the different browsers and it doesn’t depend on the embedded javascript core (which is why watir won’t run on firefox without the jssh extension). Check it out here: http://zeljkofilipin.com/2010/01/12/watir-on-webdriver/.

Leave a Reply



«
© 2010 Stanley Shilov   |   Blog   |   Contact

divide et impera

Stanley Shilov