tulios / json-viewer Goto Github PK
View Code? Open in Web Editor NEWIt is a Chrome extension for printing JSON and JSONP.
Home Page: https://chrome.google.com/webstore/detail/json-viewer/gbmdgpbipfallnflgajpaliibnhdgobh
License: MIT License
It is a Chrome extension for printing JSON and JSONP.
Home Page: https://chrome.google.com/webstore/detail/json-viewer/gbmdgpbipfallnflgajpaliibnhdgobh
License: MIT License
Expose indentUnit
to allow users to configure their own space unit.
As requested in chrome web store:
"The extension could be great if we can use our own whitespace. Maybe 4 spaces or using tabs."
I print my data using PHP function json_encode and this extension does not work.
Failed to parse the content of http://registry.npmjs.org/load-grunt-tasks
The content of that url can be found at https://drive.google.com/file/d/0B-2y3OYXQcabdFpqU0ZLN1d3YnM/edit?usp=sharing
Unknown failure, the background process never finishes. Maybe its related to the content of the key "readme" that holds some markdown with js examples
Sorry for the ultra-specific issue title, but this is some kind of extreme edge case parsing error that I just happened to stumble upon with some of our application data. After narrowing down and scrubbing the content, I was able to recreate this error:
Error: contentExtractor: Unexpected token c
at chrome-extension://gbmdgpbipfallnflgajpaliibnhdgobh/assets/viewer.js:1:1964
at a (chrome-extension://gbmdgpbipfallnflgajpaliibnhdgobh/assets/viewer.js:1:3181)
at p (chrome-extension://gbmdgpbipfallnflgajpaliibnhdgobh/assets/viewer.js:1:4366)
at new l (chrome-extension://gbmdgpbipfallnflgajpaliibnhdgobh/assets/viewer.js:1:3416)
at r (chrome-extension://gbmdgpbipfallnflgajpaliibnhdgobh/assets/viewer.js:1:1735)
at chrome-extension://gbmdgpbipfallnflgajpaliibnhdgobh/assets/viewer.js:1:1408
at o (chrome-extension://gbmdgpbipfallnflgajpaliibnhdgobh/assets/viewer.js:1:3131)
at chrome-extension://gbmdgpbipfallnflgajpaliibnhdgobh/assets/viewer.js:1:3746
at MutationObserver.r (chrome-extension://gbmdgpbipfallnflgajpaliibnhdgobh/assets/viewer.js:1:4761)
using this content:
{"a":[{"b":{"c":"1(2d)"}}]}
What's odd though, is if I re-format the JSON in IntelliJ, then json-viewer parses it fine. Here's the re-formatted content that works:
{
"a": [
{
"b": {
"c": "1(2d)"
}
}
]
}
when refreshing a page, chrome does no longer remember the last scroll position ;-(
From Shuie Yankelewitz (chrome web store support)
"array data that has a parentheses immediately adjacent to text throws an error Error: contentExtractor: Unexpected token A
"
No Good:
{"DATA":[[90,"ERROR(err)"]]}
Good:
{"DATA":[[90,"ERROR (err)"]]}
Hold SHIFT and click in one node to collapse all others at the same level.
I working on a local network so we don't use TLD in the domain name for our servers. Therefore the url in our JSON do not contain a TLD.
It seems to be that you rely on that to make text clicable or not.
Imho this should be fixed :)
It would be nice to be able to copy and paste json into some sort of console for it to be rendered. For examplle, if I am looking at the dict attributes of a python object, it essentially returns a json object.
It would be great if there is integration with firefox.
Please, divide themes by they backgrounds: dark or light. I never use bright code themes, some people never use a dark one.
JSON.parse was used to fix some encoding problems but it rounds numbers bigger than Number.MAX_VALUE. Some users have JSON files with numbers bigger than Number.MAX_VALUE (e.g. 80402000000790837 gets rounded to 80402000000790830) and it will be nice for them to have an option to skip JSON.parse and allow these kind of numbers (at least while I find a better way to handle the encode problem)
Thank you for nice extension.
Please, add a selector for quick converting to another format: for example, XML, Array ([ 'key' => 'value' ]
).
I would like to have the number of elements in a collection.
I can't imagine this will make the regular case buggy, only seems to require adapting the input size limit enforcement code I believe. Then it would be both a json viewer and json log viewer. Json log files are pretty standard at least in the node.js realm (default in popular node.js loggers) and they are more useful than text log files.
One way to get that is to turn the input from a sequence of (newline delimited) json objects to a parent json object that includes the original obejcts as an array of objects. A bit dirty as it needs to add a meaningless top level object name (e.g. named 'multiple objects' or something) but quite harmless. All that before passing on to the same display code.
?
I find myself having to copy/paste JSON from places and it would be nice to have a section in the extension for doing this. You can do it currently by typing json-viewer + tab in the Omnibox, then pasting what you want and hitting enter, but having to type json-viewer every time is slow. There is also no way to make a nice bookmark out of it. Just a page in the extension that could be bookmarked, that simply has a big text area and a button that says "Format" would be nice.
Hi,
I have noticed that for large JSON files it takes a bit for rendering the JSON visualization.
It would be nice to show in the headers the actual time it took to download the JSON so we don't suspect of server issues.
Ex:
On a 53.1Kb JSON File, it took 1.15 sec for the download to take place of this particular JSON but the plugin kept spinning for about 6 seconds... It would be nice to know the actual time the server took to process it so I don't freak out about performance issues...
(just a minor issue โ the feature still works, just a typo)
The key names for the features that fold/render all content by default are misspelled.
aways
should be always
๐ฟ
Many services, including Google, Facebook, and GitHub return JSONP that begins with a js comment in order to prevent attacks from Rosetta Flash (reference).
Example URL:
https://graph.facebook.com/SOME_ID?method=get&pretty=0&sdk=joey&callback=FB.__globalCallbacks.f1c77f051c
Unfortunately, it looks like json-viewer doesn't detect that this type of return is JSONP, and therefore doesn't style it.
I find the current themes waste too much space. Could you add a theme that is more compact with smaller font sizes? Ideally something that looks like GitHub.
Edit: Just realized you can customize font-size and font-face. Maybe just move the custom styling next to the theming :)
Please add an option for C-style object and array braces.
Java-style (current):
{
"foo" : {
"bar" : 10
},
"lol" : [
"rofl",
"lmao"
]
}
C-style:
{
"foo" :
{
"bar" : 10
},
"lol" :
[
"rofl",
"lmao"
]
}
Will be amazing if we can access the settings clicking in an icon in top right corner, for example.
The icon settings can be activated by mouseover event, so the icon will not bother anyone.
When faced with a JSON document that is:
{
"value": 8.4127988E8
}
A SyntaxError
is reported
SyntaxError: Unexpected token E
at Object.parse (native)
at chrome-extension://gbmdgpbipfallnflgajpaliibnhdgobh/assets/viewer.js:1:1410
at l (chrome-extension://gbmdgpbipfallnflgajpaliibnhdgobh/assets/viewer.js:1:2355)
at p (chrome-extension://gbmdgpbipfallnflgajpaliibnhdgobh/assets/viewer.js:1:3532)
at new a (chrome-extension://gbmdgpbipfallnflgajpaliibnhdgobh/assets/viewer.js:1:2589)
at r (chrome-extension://gbmdgpbipfallnflgajpaliibnhdgobh/assets/viewer.js:1:1330)
at chrome-extension://gbmdgpbipfallnflgajpaliibnhdgobh/assets/viewer.js:1:1008
at o (chrome-extension://gbmdgpbipfallnflgajpaliibnhdgobh/assets/viewer.js:1:2305)
at chrome-extension://gbmdgpbipfallnflgajpaliibnhdgobh/assets/viewer.js:1:2916
at MutationObserver.r (chrome-extension://gbmdgpbipfallnflgajpaliibnhdgobh/assets/viewer.js:1:3929)(anonymous function) @ chrome-extension://gbmdgpbipfallnflgajpaliibnhdgobh/assets/viewer.js:1
and only a raw rendering of the document is shown. FYI, using JSON.parse(...)
directly works fine:
> JSON.parse('{"value":8.4127988E8}')
Object {value: 841279880}
Using:
If I create an URL dynamically using URL.createObjectURL
, the extension does not detect JSON when I navigate to it.
Test code:
var blob = new Blob(['{ "lastname": "Dresden", "occupation": "Wizard" }'], {type: 'application/json'});
var url = URL.createObjectURL(blob);
$('body').append($('<a>Link to a JSON blob</a>').attr({
href: url,
target: '_blank'
}));
Hi,
I have a large .json file (641KB) and I noticed that this application will not load it, under any circumstances. I really need to have a visual layout of this massive file and I thought your extension would be the best. I wouldn't mind sending you the file somewhere in private, but as it has information not meant to be completely public, I can't just post it here.
The file comes from a JSON.stringify() call in NodeJS and is valid according to http://www.freeformatter.com/json-validator.html and http://jsonlint.com/.
Works as advertized :)
Can it also use the font shown on the settings page themes (I think it's called comic or something) rather than Chrome's default font? a thicker font is easier for 'glossing-and-fishing' which is what we typically do with json (we don't read json). (I'm a bit reluctant changing my default font in Chrome itself as I can't tell what that will also affect)
Will be amazing if I can click and export the opened json to a public gist.
While I loved the new search introduced a while back, I'm really missing this feature, which the built-in Chrome search had, that scrolled to the first hit while typing in the search text box.
Keep up the good work! You plugin is amazing ๐
Some how the c-style option is enabled by default, it should be disabled by default.
I installed the extension, but I can't figure out anywhere how to actually view the JSON from a url. I'm new to coding, so I know this is probably a dumb question.
Hi,
Congrats for this awesome extension.
One problem I have detected is that UTF-8 accentuation is not rendered normally and instead it is escaped as \uXXXX
ex:
{
"s": [
{
"r": {},
"q": "Quando voc\u00ea vai \u00e0 praia, costuma levar comes e bebes?",
"t": "select",
"fb": [],
"fdata": {}
}]
}
I'm sending the correct encoding on response headers:
Content-Encoding:gzip
Content-Length:54119
Content-Type:application/json; charset=utf-8
Any hints?
From chrome web store, user Amanpreet Singh(TECH - BLR):
"You can paste content when in Read only mode by accident and there is no way to remove it.
I am using it in conjunction with clipboard recorder like alfred. When you select the content to search first of all custom search bar goes away and things gets pasted inside the Json View.
Also custom Search Bar should not go away while i am selection an item to paste. Default chrome search bar has this behaviour. I use CMD+CTRL+V to bring paste menu due to which Viewers custom search bar goes away."
Original json encoded source:
{"href":"\/some\/path\/here"}
In extension this string looks escaped too, so I can't copy or click it. Please, show it as decoded.
It is not clear to me how to use this extension. Do you have instructions on how to load a JSON file? I typed in "json-viewer " in the text field for the Chrome browser. What do I type in next? What are the commands?
I would like to view a file on my file system. Do you have an example on how to do this?
When I copy the json, the closed itens still closed in my text editor... So I got something like this:
{ "json1":
[...],
"json2":
[...]
}
Seriously, he needs more ๐ป for this awesome extension.
Would be nice to have .json files highlighted as well
The extension is awesome, it works for http://graph.facebook.com/github and other public APIs the like, but when I'm view JSON response from my non-public devbox it's not working at all. Does it rely on something like HTTP headers to get things right?
When you hit enter in the search field it changes some values, especially urls. Someone complained in chrome web store comments but it didn't provided any ways to reproduce the error or be contacted, I think that the reported error is caused by the search.
Search for com in test.json and it should be enough to reproduce the error.
Extension doesn't render long numbers correctly.
Try 39977290059340801. In an object, it will be displayed correctly. In an array, it gets rounded down to 39977290059340800.
*Bug from Chrome Web Store
using an api call from Open Secrets.org, http://www.opensecrets.org/api/?method=getLegislators&id=NJ&apikey=&output=json , the resulting JSON is not rendered by JSON viewer. This is proper JSON though, at least according to this verifier: http://jsonlint.com/ Also, the JSON viewer is working for other API calls, such as the one from reddit: http://www.reddit.com/top.json?limit=10 Any ideas?
The JSON is highlighted just in the viewport area to allow larger files to be loaded and highlighted without delay, but I miss the fact that the search was impacted occurring just in the highlighted area. This must be fixed asap.
Right now, when viewing json files, in the right top corner there's a gear icon that links to the options. I can find those options through the extensions page as well (and honestly, I only configure those once, upon first usage), what would be more handy to see at every json file are more context-oriented links, like a link to a raw version of the json (not mangled by the extension) a link to collapse or uncollapse all nodes on the current json file etc.
Is this something in the works?
I'd love it.
First, thank you for this great extension. One issue I'm running into:
http://192.1.1.254:8085/api -> non-clickable value
http://myhost.mydomain.com:8085/api -> clickable value
Please, add two buttons beside settings button:
[ Preview ] [ Raw ]
First is enabled by default and show current view. Second will show original source.
Could you please add an option to disable the integrated search? I know it supports regex, but sometimes the Chrome find command is just simpler to use / has better readability.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.