Search code examples
fiddler

Fiddler JS formatter extension to format html conditionally


Related to: Is there a way for Fiddler JS formatter extension to work conditionally?

As far as i know that js formatter extension is based on js beautify project, and js beautify support formatting html and scripts inside them but when i use the same code that is provided in the related question which is :

if (oSession.oResponse["Content-Type"].ToLower().Contains("text/html")) {
     oSession["X-FIDDLER-JS-FORMAT"] = "yes"; 
}

I would get a messed up html structure and firefox can't show the html properly If i used X-Format-JS instead of X-FIDDLER-JS-FORMAT flag in the code above, then no formatting happens at all, so how to make js formatter formats html responses ?


Solution

  • No, Fiddler isn't based on JSBeautify and no, it doesn't support automatic formatting of JavaScript inside HTML.