XmlHttpRequest Debugging for IE

Since I wrote the original XMLHttpRequest Debugging user script for Firefox (screenshot), almost a year ago, it has received a lot of positive feedback and a number of you expressed interest in having the tool support IE, to ease your AJAX development.
Finally, here is a port of the script to run on IE, in the form of a bookmarklet: XMLHttpRequest Debugging for IE.

To use it, add the link to your favorites (ignore the security warning), go to a page you'd like to troubleshoot or analyze (such as Google Suggest) and open the bookmarklet. From there, the experience is mostly the same as with the original user script for Firefox.


The main limitation in this version is that you will get an error message if the page you're instrumenting uses any other ActiveX object than XMLHttp. This is because the bookmarklet replaces the ActiveXObject constructor as a whole, emulating the construction of XMLHttp objects, but doesn't know how to construct other types of objects.
Update (2006/05/15): Just updated the script and this limitation should be gone now. I updated the demo page (see link below) with a simple XMLDOM test case that I used to test this.

I haven't tested it that much yet, so please feel free to report any errors you run into back to me and I'll do my best to get it fixed. My email is on the help pane of the tool and the front page of this blog.

Just like my recent port of the Javascript Shell for IE, most of the code (XHR-Debugging-IE.js) actually resides on the server, rather than inside the bookmarklet itself. That's not great, but I don't know another workaround for IE's bookmarklet length limitation...
Anyways, it's possible to reference this script directly into pages that you're working on, as this simple demo shows, to avoid having to open the debugging console over and over.
This should also allow tracing earlier in the page lifecycle, catching the initial XMLHttpRequest calls. To achieve that, the script needs to be loaded after the page is loaded but before the first instantiation of an XMLHttpRequest object.
The script also includes some notes on what differs from the Firefox/Greasemonkey version, if you're interested in the technical details.

Similarly, it should be possible to convert some of my other AJAX-related user scripts, such as XMLHttpRequest - Add Latency. Let me know if you'd be interested in an IE version of this tool.

Update (2006/06/08): I just updated the script to also instrument IE7's native XMLHttpRequest object.

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

That's very interesting. We were just discussing yesterday that it would be really nice to have a latency simulator for ajax on IE. I'll put my vote it for that port!

Posted by: Chris at May 16, 2006 11:10 AM

Link for Google Suggest is: http://www.google.com/webhp?complete=1&hl=en

Posted by: Eric at June 6, 2006 01:33 PM

Thanks Eric. I fixed the link to Google Suggest.

Btw, I'm happy to report that I tried debugging the XMLHttpRequest traffic from the new Google Spreadsheet app and it worked nicely, both in Firefox/Greasemonkey and IE.

Posted by: Julien Couvreur at June 7, 2006 01:35 PM

Hey,

Sadly it does not work for me. IE shows a 'XMLHttpRequest' is undefined error. :(

Any ideas?

All ready tried reinstalling jscript.

Thanks,

Will

Posted by: war59312 at June 10, 2006 05:44 AM

This is using IE 6 on WinXP SP2.

Posted by: war59312 at June 10, 2006 05:47 AM

"Anyways, it's possible to reference this script directly into pages that you're working on, ..."

Please explain more fully!
I added http://blog.monstuff.com/archives/images/XHR-Debugging-IE.html
to my IE favorites. But what exactly do I have to do to get it to reveal XMLHttpRequest activity for a page from another server?

Posted by: Herb at July 13, 2006 02:34 AM

Herb,

The direct way of using this script is by bookmarking the special link above:
"Finally, here is a port of the script to run on IE, in the form of a
bookmarklet: __XMLHttpRequest Debugging for IE__."

This is a special link because instead of an http: url it's a javascript: url.

The other way is to include a
<script src="</script>">http:// ...path... /XHR-Debugging-IE.js"></script>
tag in the page that you want to instrument.

Posted by: Julien Couvreur at July 13, 2006 01:32 PM

Thanks a lot for the tools. I have a problem with xmlHTTPRequest object and hope you could solve that.

I'm making a call using xmlHTTPRequest object to a secure page, from a non-secure page. Both pages are in the same domain. At the xmlHTTPRequest.open method, I'm getting the error 'Unhandled exception, permission denied to call method xmlhttprequest.open'.

Any help is greatly appreciated.

Posted by: Prasad at July 27, 2006 12:43 AM

I love XMLHttp,manytimes,it is useful to do what you want to do. can you writ something about XMLHttp?

Posted by: 翻译公司 at August 1, 2006 06:18 PM
Trackbacks
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
Debugging AJAX - Here is Help
Excerpt:
Weblog: .NET & C# by Daniel Fisher(lennybacon) from Wuppertal
Tracked: May 16, 2006 05:04 AM
上周技术关注:.NET开发人员对动态语言应该持什么样的态度
Excerpt: Are you sure you want to be mainstream? 这是让任何技术开发人员和技术投资者头痛和非常容易引起思考的一个问题。如果用这个问题结束有关动态语言和静态语言的争执,我想,最后的问题也许是-你...
Weblog: 曾登高
Tracked: May 22, 2006 11:10 PM