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 01, 2007 2:07 PM by Michael Schwarz
Filed under:

Comments

# re: Fiddler2 - JavaScript Beautifier Plugin

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

This is usually called "Pretty printing"

# re: Fiddler2 - JavaScript Beautifier Plugin

Wednesday, August 01, 2007 10:16 AM by normalman

thank you

# re: Fiddler2 - JavaScript Beautifier Plugin

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

Nice plugin, thanks!

# re: Fiddler2 - JavaScript Beautifier Plugin

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

I have a question where can i get Fiddler2 ?

# re: Fiddler2 - JavaScript Beautifier Plugin

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

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

# re: Fiddler2 - JavaScript Beautifier Plugin

Wednesday, August 01, 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 01, 2007 2:53 PM by Denny Ferrassoli

Can't wait for the plugin!

# re: Fiddler2 - JavaScript Beautifier Plugin

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

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

# re: Fiddler2 - JavaScript Beautifier Plugin

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

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

# 本周ASP.NET英文技术文章推荐[07/29 - 08/04]:VS 2008、.NET 3.5、ASP.NET AJAX、ObjectDataSource、Fiddler、Silverlight、ASP.NET 3.5、ListView、DataPager

Friday, August 03, 2007 5:52 AM by Dflying Chen

摘要本期共有8篇文章:.NET3.5和VS2008中的ASP.NETAJAX将应用ASP.NETAJAX1.0的Web站点和Web应用程序升级到.NETFramework3.5...

# Miguel de Icaza: Javascript Decompressor Roundup

Friday, November 16, 2007 3:30 PM by 工程師的雞排攤

Thanks to everyone that emailed me answers to the Javascript decompressor issue. This is a reply in case