How to deminify javascript [duplicate]
Asked Answered
E

3

25

Possible Duplicate:
Online Tool to Unminify / Decompress JavaScript
Tool to reverse Javascript minify?

Is there a way to convert minified JavaScript code into normal?

Eolanda answered 3/10, 2011 at 12:19 Comment(2)
#822619Emulsoid
strictly-software.com/unpackerArmoire
O
33

http://jsbeautifier.org/ works like a charm.

Most software distributed under the GPL license will also provide non-minified code.

Ostia answered 3/10, 2011 at 12:20 Comment(5)
It does not de-obfuscate names of variables.Buckthorn
@Buckthorn how would it do that? You would have to give it a list of the original variable names and their obfuscated counterparts.Plassey
@Plassey you are correct. Please check out source maps. html5rocks.com/en/tutorials/developertools/sourcemapsChurr
@Churr thanks, very interesting! Has the idea been adopted more widely since the article was written in 2012? I've Googled it and it still seems largely a Mozilla thing. Someone has created a NuGet package for DotNet, but this still seems in prototype stage.Plassey
@Plassey Source maps are supported by at least Firefox, Safari, Chrome (and Opera), IE/Edge. There are also plenty of tools available outside the browser (many on npm); from the top of my head I also know that there is a Python implementation, and I would not be surprised if there was an implementation in your favorite language.Ostia
W
5

I use WebStorm by JetBrains for my Javascript IDE, it has auto-format which seems to do the trick pretty well.

Wooer answered 3/10, 2011 at 12:22 Comment(1)
Also it is possible in phpstorm. Menu "Code" -> "Reformat Code" or Ctrl+Alt+LTersanctus
U
2

Chrome's native object inspector will format JS for you, but it won't be able to make sense of the variable names - nothing will.

If you want an online solution, use JSBeautifier. It works well, and is also very handy for making sense of some of the questions you see here on StackOverflow.

Unpromising answered 3/10, 2011 at 12:21 Comment(1)
'nothing will' I mean a human stepping through the code could. It might be nice to have a tool to "fill back in the values that a human knows"Mender

© 2022 - 2024 — McMap. All rights reserved.