25

The "pretty print" button, located in the lower left corner of the Chrome Developer Tools window, is supposed to make minified code readable. However, when I click it, nothing happens. I tried both single and double-clicks. This happes on Chrome 32 on Windows.

How do I make the pretty-print button work?

Helge Klein
  • 8,829
  • 8
  • 51
  • 71

2 Answers2

7

I just stumbled upon this problem and, while Pretty-print doesn't do anything for me, I make it work by clicking the curly braces icon {} in the left bottom corner on the status bar. This suggestion came from Learn more button next to Pretty-print.

enter image description here

iamkirill
  • 310
  • 1
  • 6
  • 12
1

As I found out the hard way (by trial and error) the "pretty print" button is only functional when the console is visible. That means it does not work here:

enter image description here

But it does work here (console visible):

enter image description here

Helge Klein
  • 8,829
  • 8
  • 51
  • 71
  • How can you tell? If you're looking at the console window, how can you see whether the source code is formatted? – Barmar Jan 29 '14 at 23:10
  • Obviously I resized the window prior to taking the screenshot. In order to make that crystal-clear I replaced the second screenshot with a new one. – Helge Klein Jan 29 '14 at 23:15
  • 32
    Doesn't make any difference for me -- it doesn't work in either case. – John Aug 09 '14 at 18:45
  • 1
    Still no dice for me when I try to prettify [this javascript](http://code.highcharts.com/mapdata/custom/africa.js). [Here's a screenshot](http://i.imgur.com/nGDxCa3.png) – KyleMit Dec 17 '14 at 01:27
  • 2
    not working for me either. the button opens a new tab with the same non-prettified code. – knarf Apr 29 '15 at 12:15
  • it doesn't work for me either, but I have included a large library in my javascript file and I think that might be the reason. – Jespertheend Jul 10 '19 at 09:57
  • I switched to firefox for now, which can beatify my script just fine. – Jespertheend Jul 10 '19 at 10:20
  • My issue was that I had commented out a comment in my code, so it couldn't format it. It worked once I fixed that. Make sure you don't have any syntax errors in your code. – Roya Oct 16 '19 at 19:03