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

試著忘記壹切 提交于 2019-11-27 03:47:22

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.

Someone has made JSBeautifier into a Firebug plugin:

https://addons.mozilla.org/en-US/firefox/addon/javascript-deminifier/

This has made my day today!

Venkman JavaScript debugger has a pretty-printer.

There is also an extension for Fiddler proxy.

IE9 developer tools also have a "format javascript" option (see "F12 Developer Tools and Formatting Minified Script" here)

FYI - the same functionality is available in IE9's F12 Developer Tools: With script tab open, select the hammer/wrench button on the button bar ("Configuration"), and select "Format JavaScript".

If the script is only minified for whitespace, some of the solutions offered may work. As you mention, JSBeautifier is a useful tool.

However, if the JavaScript you're looking at has been compressed with a tool such as YUI Compressor or Google Closure Compiler, the variables are going to be shortened and harder to understand.

To see this in action, compare the minified and unminified versions of jQuery (minified version uses Closure Compiler).

For the goal of learning JavaScript, I recommend learning from libraries and plugins written by some of the best JavaScript developers out there. Look at the source code for jQuery, YUI, Moo Tools. Look at code on GitHub by people like John Resig or Thomas Fuchs. Read DailyJs and look at his examples.

I hope some of these tools help you in the process of learning. These are the resources that have helped me most.

Webkit/Chromium can now do this as well, see Webkit Bug 57942, Changeset 83713 and Peter Beverloo's change summary post mentioning this.

Don't ask me starting with which version of Chromium/Chrome this is available, but feel free to mention here if you do know. :)

Ciro Santilli 新疆改造中心996ICU六四事件

"Auto Prettify Minified Sources" setting of Firefox Firefox Developer Tools turns the Prettify Source feature on by default.

To enable it:

  • open Firefox Developer Tools (Ctrl + Shift + I)
  • Debugger tab
  • engine icon on top right of the Debugger tab, not the global settings engine

This is documented at: https://developer.mozilla.org/en-US/docs/Tools/Debugger/How_to/Pretty-print_a_minified_file

Tested on Firefox 42.

Is not possible with current tools. Show eval scripts is the most you can get. Jsbeautifier.org is nice open thing, and someone can integrate it info firebug.

PrettyPrint is a nice chrome extension for this, it automatically unminifies js in a heartbeat while using regular (Ctrl-U) source.

You can get it here:

https://chrome.google.com/webstore/detail/prettyprint/nipdlgebaanapcphbcidpmmmkcecpkhg/

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