Human readable javascripts in chrome developer tools

随声附和 提交于 2019-12-17 08:09:52

问题


does anybody know whether Chrome Developer Tools can format javascripts into human readable form ? Some kind of beautifier would be handy. Let say that I'm using some JS library and I need to instantiate its object, so that I should know what to put into constructor. But searching through this huge library that has 4 lines in the Chrome Developer Tools user interface is quite annoying...

Otherwise the server side needs to take care of implementing "dev mode" that supplies javascript files that are not minified ...


回答1:


Some browsers have a Pretty print button that looks like this {} and it appears for HTML, JS, and/or CSS depending on the browser.

Chrome has it in the in the Sources tab:

Firefox has it in the in the Debugger tab

:

The position of these buttons may change, but it should always be in there




回答2:


Isn't there the Pretty Print icon (looks like: { }), at least on Windows there is one, within the Scripts tab?




回答3:


There is the http://jsbeautifier.org/ for online usage (you need to copy/paste).

On that site they have a link to fiddler (a web debugging proxy) and a JavaScript Formatter for it (3rd extention).



来源:https://stackoverflow.com/questions/4484407/human-readable-javascripts-in-chrome-developer-tools

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