chrome json插件_如何使用此免费的Chrome扩展程序(或Firefox插件)获取易于阅读的JSON树

chrome json插件

JSON is a very popular file format. Sometimes we may have a JSON object inside a browser tab that we need to read and this can be difficult.

JSON是一种非常流行的文件格式。 有时我们可能需要在浏览器选项卡中包含一个JSON对象,这很困难。

We may need to go and search for an online tool that turns it into an easy-to-read format so we can understand it.

我们可能需要搜索一种在线工具,将其转换为易于阅读的格式,以便我们能够理解它。

Now, here is a Chrome and Firefox extension that does the formatting and makes your JSONs instantly pretty inside your browser, without having to perform many unnecessary steps.

现在,这是一个Chrome和Firefox扩展程序,它可以进行格式化,并使您的JSON立即在您的浏览器中显示,而无需执行许多不必要的步骤。

It comes with support for JSON and JSONP and highlights the syntax so that you can differentiate different attributes and values accordingly. It also comes with the option to collapse nodes, clickable URLs that you can open in new tabs, and you see the raw, unformatted JSON.

它带有对JSON和JSONP的支持,并突出显示了语法,以便您可以相应区分不同的属性和值。 它还提供了折叠节点的选项,可以在新选项卡中打开的可单击URL,以及原始的,未格式化的JSON。

It works with any JSON page, regardless of the URL you opened. It also works with local files, after you enable it in chrome://extensions. You can inspect the JSON by typing json into the console.

不管您打开的URL是什么,它都可以与任何JSON页面一起使用。 在chrome://extensions启用本地文件后,它也可以使用。 您可以通过在控制台中输入json来检查JSON。

You can install the extension by going here for Chrome and here for Firefox and then test it, for example, by visiting this API response.

您可以通过以下途径安装扩展程序: ChromeFirefox ,然后通过访问此API响应进行测试

This is what it looks like, before formatting:

格式化之前是这样的:

Now, take a look at the beautiful JSON response you get with JSON Formatter:

现在,看看使用JSON Formatter获得的漂亮的JSON响应:

Here is a pro tip: Hold down CTRL (or CMD on Mac) while collapsing a tree, if you want to collapse all its siblings too.

这是一个专业提示:如果要折叠其所有同级树,请在折叠树时按住CTRL(在Mac上为CMD)。

It is an open-source project, so you can view its source code on GitHub.

这是一个开源项目,因此您可以在GitHub上查看其源代码

Thanks for reading.

谢谢阅读。

翻译自: https://www.freecodecamp.org/news/untitleeasy-to-read-json-with-this-chrome-firefox-extensiond/

chrome json插件

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值