Update: Thanks for the responses so far. To clarify, I'm not really looking for a logger, but more of a debugger/tracer -- I want a dump of every piece of JavaScript that executed and when it executed. I tried Venkman earlier today but it isn't very stable. My theory is that something is going wrong deep in the Dojo code, or even the Firefox code.
This only happens in Firefox 3.5 - 3.6 when Firebug is disabled (or just not installed).
Basically, I'm sending an AJAX request in Dojo 0.4.3 (I know!) using dojo.io.bind (now deprecated!). If you're familiar, it's using dojo.io.XMLHTTPTransport as the transport. Now, basically the way it works is that it sends the XHR and then has a watcher function called startWatchingInFlight
that gets called every 10ms to check on the XHR's readyState property. When the property is 4, it does a bunch of stuff:
dojo.io.XMLHTTPTransport = new function () { /* I know, I know. I would never do this */
// somewhere in XMLHTTPTransport ...
this.startWatchingInFlight = function () {
// alert('watching...');
if (!this.inFlightTimer) {
this.inFlightTimer = setTimeout("dojo.io.XMLHTTPTransport.watchInFlight();",10);
}
};
this.watchInFlight = function () {
// alert('a glance');
// do a bunch of stuff...
var tif = foo(); // well, never mind how we get it but it's the object in flight
// tif.http is the XHR object
if (4 == tif.http.readyState) {
// call some stuff
}
}
this.bind = function (args) {
// somewhere in XMLHTTPTransport.bind ....
this.startWatchingInFlight();
http.send(query); // Again, http is the already-opened XHR object
// and so on
}
}
Now, here's the fun part! If I were to uncomment those two alerts up above, when this code is executed I would only get one alert: 'watching...'. Something happens in the 10ms before the first call to watchInFlight
that prevents it from being called. (EDIT: I've also used logging statements instead of alerts to the same effect.)
So, what I need is a way to trace the JavaScript thread to see what is blocking the first call to watchInFlight
. Though, if you have a solution to the above problem, I'll also take that.
Restrictions: I cannot use another library unless you can get it to play nice with Dojo 0.4.3 (I think I just threw up a little in my mouth...I'm kidding. Dojo has always been a good library).
Any help would be very appreciated.