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.
您可以通過以下途徑安裝擴展程序: Chrome和Firefox ,然后通過訪問此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插件