Chrome 开发者工具中人类可读的 JavaScript
有人知道 Chrome 开发者工具是否可以将 javascript 格式化为人类可读的形式吗?某种美容剂会很方便。假设我正在使用一些 JS 库,并且我需要实例化它的对象,以便我应该知道要放入构造函数中的内容。但是在 Chrome 开发者工具用户界面中搜索这个有 4 行的巨大库是相当烦人的...
否则服务器端需要负责实现“开发模式”,提供未缩小的 javascript 文件...
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 ...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
某些浏览器有一个类似于
{}
的漂亮打印按钮,并且根据浏览器的不同,它会针对 HTML、JS 和/或 CSS 显示。Chrome 的来源选项卡中:
Firefox 的调试器选项卡中的
:
这些按钮的位置可能会改变,但它应该永远在那里
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
有http://jsbeautifier.org/供在线使用(您需要复制/粘贴)。
在该网站上,他们有一个指向 fiddler(网络调试代理)的链接和JavaScript 格式化程序(第三个扩展)。
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).