3 Star 2 Fork 2

Gitee 极速下载/jsonview

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/bhollis/jsonview
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

JSONView

JSONView is a Web extension compatible with Firefox and Google Chrome that helps you view JSON documents in the browser.

Normally, when encountering a JSON document (content type application/json), Firefox simply prompts you to download the view. With the JSONView extension, JSON documents are shown in the browser similar to how XML documents are shown. The document is formatted, highlighted, and arrays and objects can be collapsed. Even if the JSON document contains errors, JSONView will still show the raw text.

Once you've got JSONView installed, check out this example JSON file to see the extension in action!

If you'd like to contribute to JSONView but don't want to code, consider contributing a translation. Copy the existing localization files from src/_locale and fill them in for your own language, then send a pull request. You can do it all from the GitHub interface. There are not many strings to translate!

Keyboard Shortcuts

  • Left Arrow - Collapses the json on key up
  • Right Arrow - Expands the json on key up

Reporting Issues

Use the GitHub Issue tracker for JSONView to file issues. Pull requests are especially welcome.

Developing JSONView

Before contributing to JSONView, make sure to read the Contributing Guidelines. I appreciate contributions people make to JSONView, but the goal of the extension is to be simple and straightforward, so I frequently reject contributions that add complexity or unnecessary features. Please consider filing an issue before doing any work, so you don't waste time on something I won't accept.

  • Install NodeJS and run corepack enable.
  • Check out jsonview.
  • Run pnpm i inside the jsonview repository.
  • Run pnpm start to build the extension.
  • In Firefox, go to about:debugging#addons in the address bar, check "Enable add-on debugging", select "Load Temporary Add-on", and choose the jsonview/build-firefox/manifest.json file.
  • In Chrome, Edge, etc., go to edge://extensions/, in the address bar, enable "Developer mode", select "Load Unpacked", and choose the jsonview/build-chrome folder.
  • Run pnpm tests to start a little webserver that serves all the JSON files in ./tests.

JSONView makes use of TypeScript. I recommend VSCode for editing the code - it will automatically prompt to install the correct extensions, and will highlight errors. All of the code that makes up the extension itself are in src/.

Common Issues

  • JSONView isn't displaying my file as JSON: You are probably not serving the JSON with the "application/json" MIME type.
  • Opening a local .json file uses the Firefox default JSON viewer: You need to disable the built-in JSON viewer to use JSONView. Go to "about:config" and set "devtools.jsonview.enabled" to "false".

JSONView is open source software under the MIT license.

Publishing

pnpm start

jsonview-chrome.zip and jsonview-firefox.zip can then be manually uploaded to the extension sites.

MIT License Copyright (c) 2009 Benjamin Hollis Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

JSONView 是一个与 Firefox 和 Google Chrome 兼容的网络扩展,帮助你在浏览器中查看 JSON 文档 展开 收起
JavaScript 等 4 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/mirrors/jsonview.git
git@gitee.com:mirrors/jsonview.git
mirrors
jsonview
jsonview
master

搜索帮助