Chrome 开发者工具中人类可读的 JavaScript

发布于 2024-10-08 01:12:57 字数 205 浏览 0 评论 0原文

有人知道 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

深海里的那抹蓝 2024-10-15 01:12:57

某些浏览器有一个类似于 {}漂亮打印按钮,并且根据浏览器的不同,它会针对 HTML、JS 和/或 CSS 显示。

Chrome 的来源选项卡中:

Chrome 40 漂亮的打印按钮

Firefox 的调试器选项卡中的

Firefox 35 prettify源按钮

这些按钮的位置可能会改变,但它应该永远在那里

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:

Chrome 40 pretty print button

Firefox has it in the in the Debugger tab

Firefox 35 prettify source button:

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

优雅的叶子 2024-10-15 01:12:57

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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文