Venkman Debugger To The Rescue

Relates to DOM Scripting and Firefox and Co, XUL

I have had some problems getting the XUL Console to work on Mozilla 1.6. I caught a brief glimpse of the sample widgets the first time I ran it, but since then the console has been blank and totally functionless. Since I was keen to utilise the downloaded version of Alice Corbin's Periodic Table to help learn the markup, and with lack of bug reports for the console on MozDev, I decided to try and debug it myself.

The JavaScript Console told me the error was an unrecognised path in the file chrome://mozlib/content/lib/js/io/file/instantiator.js, part of the MozLib extension library. So, enter the Venkman JavaScript Debugger. This was the first time I had test run this for genuine reasons, but it is relatively easy and intuitive to get going.

  1. Open up the Debugger.
  2. Uncheck the Exclude Browser Files option in the Debug menu since the target was part of the chrome.
  3. Start up the XUL Console.
  4. Locate the file instantiator.js in the Loaded Scripts window and set a break point on the line the error was occurring (Line 73).
  5. Attempt to perform a function in the XUL Console.
  6. The Debugger stops on the breakpoint, and the variable at fault can be examined.

The error was clear, the directory path to Mozilla was set in Windows format with escaped backslashes, while the additional path to the particular file (in this case the samples) was set with forward slashes. (One of the many Windows banes!). Well, time was not available to delve deep into the MozLib library and find out where this was originating, so I settled with adding a regular expression snippet at this point to correct the path and see if that would work.


var re = /\//g;
var result = path.replace(re, "\\");
path = result;

The problem was resolved and now the XUL Console is functioning perfectly. I could have quite easily passed an hour reinstalling the extensions and editing chrome files in an attempt to fix this, but in 5 minutes Venkman had pointed me in the right direction and the problem was resolved - an excellent tool!

Posted on Sunday, Mar 07, 2004 at 20:45:12.

Comments on Venkman Debugger To The Rescue (1)

α comment

The problem with MozLib seems to be solved in the last version.

Nice site, btw

Posted by ghaspias
Tuesday, Sep 21, 2004 at 14:39:02

Breadcrumbs Trail

[ Home ] -> TW Blog -> Mar 04 -> Venkman Debugger To The Rescue
Site Map

The Severn Solutions website achieves the following standards:

[ XHTML 1.0 ] [ CSS 2 ] [ WAI AA ] [ Bobby AA ]

Page compiled in 0.047 seconds