Fiddler2 - JavaScript Beautifier Plugin

Update: download first alpha version of the PrettyPrint plugin for Fiddler2.

I think everybody is doing this: you open a Web page and see some nice and tricky effects. Next you start Fiddler2 (which is my favorite tool for Web developers!!) and have a more detailed look in the content transferred from server to the client. Fiddler2 includes an automatic encoding removal which means that you can view text files without having to unzip to content first.

During the last years more and more Web developers have obfuscated their JavaScript files. Have a look following short example:

JsonRequestBuilder=function(b,c){var dynamicScript=new 
DynamicScript(b,c);JsonRequest=function(g,h,j,k,l,b,c){var 
responseFunc=h;var callback=k;this.Callback=function(j,m){var
 readyState=m;var responseObject=null;try{if(m=="loaded"||m==
"complete"){responseObject=eval(responseFunc+"();");eval
("window."+responseFunc+" = null;");}}catch(e){readyState=
"error";}finally{callbac(responseObject,j,readyState);}};this.
rawRequest=dynamicScript.CreateReques(g,j,this.Callback,l,b,c);
this.Execute=function(){this.rawRequest.Execute();};this.
Abort=function(){this.rawRequest.Abort();};};function n
// [...]

Well, would't it be great if obfuscated JavaScript code would be formatted a little bit nicer? Yes, I have done a small test with one of my libraries and created a Fiddler2 plugin. See the results below:

I hope to get the Plugin working correct until end of this week, nearly all types of JavaScript coding are working already. On Friday I will publish a first beta version.

Published Wednesday, August 1, 2007 2:07 PM by Michael Schwarz
Filed under:

Comments

# re: Fiddler2 - JavaScript Beautifier Plugin

Wednesday, August 1, 2007 9:19 AM by Anon

This is usually called "Pretty printing"

# re: Fiddler2 - JavaScript Beautifier Plugin

Wednesday, August 1, 2007 10:20 AM by .net resource center

Nice plugin, thanks!

# re: Fiddler2 - JavaScript Beautifier Plugin

Wednesday, August 1, 2007 12:58 PM by Lance Bailey

I have a question where can i get Fiddler2 ?

# re: Fiddler2 - JavaScript Beautifier Plugin

Wednesday, August 1, 2007 2:01 PM by Michael Schwarz

@Lance: you can download it at fiddler2.com/.../version.asp

# re: Fiddler2 - JavaScript Beautifier Plugin

Wednesday, August 1, 2007 2:18 PM by OmegaSupreme

Nice work, now I can delve into all that Gmail code :D etc

# re: Fiddler2 - JavaScript Beautifier Plugin

Wednesday, August 1, 2007 2:53 PM by Denny Ferrassoli

Can't wait for the plugin!

# re: Fiddler2 - JavaScript Beautifier Plugin

Wednesday, August 1, 2007 3:20 PM by Michael Schwarz

@Denny: I hope to publish a beta version already today... ;)

# re: Fiddler2 - JavaScript Beautifier Plugin

Thursday, August 2, 2007 12:18 AM by Vikram

good one. Does it work with asp.net ajax extension also?