Tool to Unminify/Decompress JavaScript

Tool to Unminify / Decompress JavaScript

You can use this : http://jsbeautifier.org/
But it depends on the minify method you are using, this one only formats the code, it doesn't change variable names, nor uncompress base62 encoding.

edit: in fact it can unpack "packed" scripts (packed with Dean Edward's packer : http://dean.edwards.name/packer/)

Unminify / Decompress JavaScript

The thing is that you cannot really "unminify" your code since some data was already lost - e.g. variable names. You can reformat it to more readable form though.

  1. According to this question, since VisualStudio 2012 you can just use Ctrl+E, D keyboard shortcut
  2. If the above is not right, there is this extension for VS 2010: http://visualstudiogallery.msdn.microsoft.com/41a0cc2f-eefd-4342-9fa9-3626855ca22a but I am not sure if it works with VS 2013
  3. There is an extension to VisualStudio called ReSharper which can reformat javascript in a few different manners.
  4. Also there are online formatters already mentioned in other answers (if your code is confidential, I would advise some paranoia manifested by downloading sources and using them locally).
  5. Also you may always try to find unminified version of desired library on the interwebs
  6. Also, there is the WebStorm IDE from JetBrains that is able to reformat JS - you may download a trial for the sole purpose of reformatting your minified scripts :)
  7. If that's just to make debugging easier, you may want to use source maps

Also, here is a bunch of related questions:

How to automatically indent source code? <-- this is for VS2010, but it looks promising, maybe it will help you if it supports JavaScript (and it does since VS2012 according to MS support):

Ctrl+E, D - Format whole doc

Ctrl+K, Ctrl+F - Format selection

reindent(reformat) minimized jquery/javascript file in visual studio

Visual Studio 2010 can't format complex JavaScript documents

Visual Studio code formatter

how to make visual studio javascript formatting work?

I am not sure if they figured out a working way to reformat JS, but I've seen a few answers which might be helpful - I am just pasting this in here just FYI.

Added 03.06.2014:

http://www.jsnice.org/

This tool could be useful too, it even tries to infer minified names. As stated on their website:

We will rename variables and parameters to names that we learn from thousands of open source projects.

Is there a plugin that allows me to automatically unminify the Javascript included on a site?

In chrome 13+, there is 'pretty print'.

  1. Right click 'inspect element'
  2. Go to Script tab
  3. Click the curly braces in the bottom right.

Screenshot



Related Topics



Leave a reply



Submit