Human readable javascripts in chrome developer tools

lisak picture lisak · Dec 19, 2010 · Viewed 47.1k times · Source

does anybody know whether Chrome Developer Tools can format javascripts into human readable form ? Some kind of beautifier would be handy. Let say that I'm using some JS library and I need to instantiate its object, so that I should know what to put into constructor. But searching through this huge library that has 4 lines in the Chrome Developer Tools user interface is quite annoying...

Otherwise the server side needs to take care of implementing "dev mode" that supplies javascript files that are not minified ...

Answer

fgm2r picture fgm2r · Jun 11, 2011

Some browsers have a Pretty print button that looks like this {} and it appears for HTML, JS, and/or CSS depending on the browser.

Chrome has it in the in the Sources tab:

Chrome 40 pretty print button

Firefox has it in the in the Debugger tab

Firefox 35 prettify source button:

The position of these buttons may change, but it should always be in there