Thursday, March 6, 2008

Firebug for OSX

Firebug is an amazing debugging tool but some of us believe that it makes Firefox unstable and I've seen cases where without restarting Firefox, it just stops working so I want to be able to restart Firefox without losing all of my other windows.

The solution to this problem is simple. Since you only want to use Firebug when debugging your own websites (or improving the look and feel which is where it is a true blessing), you just need a separate process running Firefox with Firebug in it than you use for your everyday browsing.

Here is how to do it for OS X (it should then be obvious how to do it for Linux by replacing the bizarre path with whatever `which firefox2` or whatever version you are using returns).

First set up a new debug Firefox profile. Execute this from a shell:


MOZ_NO_REMOTE=1 /Applications/Firefox2.app/Contents/MacOS/firefox -ProfileManager


Use the UI to make a new profile called "debug" and let it save the profile in the strange place it decides (since it really doesn't matter).

Now create your firefox debug script which I call "defox":


#!/bin/bash
MOZ_NO_REMOTE=1 /Applications/Firefox2.app/Contents/MacOS/firefox -P debug


chmod defox to be executable and put it on your path. Then execute it. You should now get a new Firefox process even if you are running your default firefox profile. With that new Firefox started, goto Tools->Add-ons and then click on the little text that says "Get Extensions". At the Mozilla site, search for firebug, click the obvious link and then the install now link which should download it and finish that process off. It will probably restart your debugging firefox instance and then you are good to go by clicking the icon it puts in the button of your window. Search for the internet to learn more about that.

At least under linux, "killall defox" lets me kill my debugging firefox when either it or firebug gets tired. The great thing is that is will ask to restore the session and I tend to get the one or two debugging windows back and I'm off to the races.

No comments:

About Me

My photo
I'm currently a software engineer at Google though I've worked at other companies as well.