As a JS dev, I very frequently use Fiddler tool. I also use its addon JavaScript Formatter to nicely format minified files for debugging purposes.
However, the problem is that the JS formatter doesn’t seem to be configurable at all, and works on “all-or-nothing” base.
Problem:
In my company, we sometimes bundle a lot of (not JS, but compilable to JS) files together, serve it as JS, and then, rely on that file format to parse them and load properly. This may sound strange, but it’s to avoid having tens of micro files, and have a one bundle with all of them.
So basically, the file looks like:
//MAGICCOMMENT
//FILEID
markup
markup
...
markup
//FILEID
markup
markup
...
markup
and so on.
Question:
Is there any way to tell Fiddler not to prettify that files? We have a //MAGICCOMMENT in the first line, which is the same for all the multipart files, which can perhaps be used to detect it, but I don’t know if and how can I make use of it.
PS: I guess we can’t change the MIME type of the served files.
Edit:
I know the “Make JavaScript Pretty” option in Rules menu, which is added after installing the JS Formatter plugin. I want to make this option working conditionally (but: at the time of sending data to the browser, so I can put breakpoints in the browser on the prettified JS source, for all the files that I want to be prettified, i.e. the files other than the multiparts).
For now, you can just disable the “Make JavaScript Pretty” item on the Fiddler Rules menu. When you want to beautify an individual JavaScript file, you can do so by right-clicking the session in the Web Sessions list and choosing Make JavaScript Pretty directly on the session.
Alternatively, you can disable the global option and have FiddlerScript conditionally format the JS File. E.g. inside Rules > Customize Rules > OnPeekAtResponseHeaders()