XmlHttpRequest Debugging (Firefox 1.5 update)

Here's XmlHttpRequest - Debugging (version 1.2), an update on the original.
The script now works in Firefox 1.5 with Greasemonkey 0.6.4.

Thanks to the readers who reported the problem for their help and patience.

The problem was caused by Greasemonkey's new injection system, which doesn't allow the userscript to access the XMLHttpRequest object in the page anymore.

As a workaround, the script escapes the Greasemonkey sandbox by eval'ing itself in the context of the page.
On the downside, it means that the injected code loses the ability to call Greasemonkey functions such as GM_getValue, GM_setValue or GM_registerMenuCommand. This means that the console won't remember its state (position, settings,...) between page loads and I also had to disable the "hide" functionality.

Here's the essence of the change:

function injectMe() {
  ... original userscript ...

Update (2005/01/12): According to Aaron Boodman (Greasemonkey creator) on the mailing list, unsafeWindow.XMLHttpRequest should still be available from the userscript. I'll investigate a bit more, but at least the script is working again now.

Update (2005/05/12): I just ported this script to IE, using a bookmarklet.

Posted by Julien on January 12, 2006. Permalink
comments powered by Disqus

I get a "Config is not defined" error on line 117 of the greasemonkey.js script... ?

Posted by: Ryan at March 5, 2006 05:27 PM

Thanks for your XMLHttpRequest Debugging v1.2

Actually v1.0 disappointed me but v1.2 is awesome.

I deeply appreciate your working.

Sincerely Eric.

Simple life High Thinking
at blog.naver.com/jinoxst

Posted by: Eric at March 6, 2006 12:46 AM

This seems to be a problem with Greasemonkey itself. I googled the error you pasted ("Config is not defined") and found some info on the Greaseblog. I didn't get the time to go through the details, but I think you'll find some tips on fixing this there.

Here's a comment thread where this error is mentioned:

Posted by: Julien Couvreur at March 6, 2006 09:39 AM

Greasemonkey 0.6.4

When I attempt to install XmlHttpRequest - Debugging (version 1.2), I get an alert:

Error installing user script:
[Exception... "Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIChannel.open]" nsresult: "0x80520012 (NS_FILE_NOT_FOUND)" location: "JS frame :: chrome://greasemonkey/content/utils.js :: getContents :: line 167" data: no]

Any ideas as to what is wrong?

Posted by: Gary Krajci at April 25, 2006 11:51 AM


I've installed greasemonkey.

I'm using Firefox

When I enter a website to monitor and navigate to the site, the debugging screen pops up, but nothing ever happens when I enter search criteria (ex: www.google.com/webhp).

Posted by: David Johnson at August 6, 2006 09:37 AM
XmlHttpRequest Debugging for IE
Excerpt: 对Ajax的调试很有用。虽然现在很少用IE了,不过对IE下的Developer很有帮助。XmlHttpRequest Debugging for IE这里是For IE的
Weblog: BuG & bUg
Tracked: May 15, 2006 09:00 AM