Reverse Uglified Javascript Code

人盡茶涼 提交于 2019-11-30 02:54:41

问题


I am looking for way (preferably and online site) to a reverse Uglify of some javascript. The Website: http://jsbeautifier.org/ is great for minifed code, but it is does not do a great job for ugly stuff.


回答1:


There is this awesome online tool, JSNice, that makes a great job of finding names to obfuscated variables.

We make even obfuscated JavaScript code readable. We will rename variables and parameters to names that we learn from thousands of open source projects. Furthermore, often we are also able to guess or infer type annotations.




回答2:


chrome dev tools also can do this.

point no 2 in http://www.elijahmanor.com/2011/08/7-chrome-tips-developers-designers-may.html




回答3:


Depends on what options you used when you uglify your code. If you just remove the line breaks, then Chrome dev tools will be able to do a great work as sirinivas explained. But if you mangle the code, then ther is no way you can get the exact previous code. (in uglifying var logngvariable = a + b; becomes var c=a+b;. there is no way a tool can figure out the previous name logngvariable )

On the otherhand if you want an un-uglified code you may not uglify it at the first place... :)




回答4:


Despite isn't an online site, IMO the best choice is to install UglifyJS2 as command line tool.

It's as easy as npm install uglify-js -g and after this you can enter in your command line client uglifyjs [input files] [options]

npm

Hope this helps.

Download



来源:https://stackoverflow.com/questions/18408535/reverse-uglified-javascript-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!