I have seen people put all their JS code into one single line. (something like this: http://www.drasticdata.nl/DrasticTreemap/Examples/js/swfobject.js) I know they are trying to protect their IP. But I want to read the code and study it.
Is there a way to make those one-line code readable? For example, break it down to multiple lines?
Thanks.
A quick google search for “JavaScript de-obfuscator” will return you multiple online parsers that format obfuscated code into something formatted and readable.
The following works pretty well:
http://jsbeautifier.org/
There is no way to rename variable names to their, once semantic, forms. Something you’ll have to tread through…
A couple of terms to note minification and obfuscation:
Minification (Wikipedia)
Obfuscation (Wikipedia)
References
http://en.wikipedia.org/wiki/Obfuscated_code
http://en.wikipedia.org/wiki/Minification_(programming)