It would be cool if JSON responses were formatted (like in Firefox) instead of rendered as plain text. Plain text should remain as an option though.
Sample JSON: https://www.reddit.com/r/all.json
It would be cool if JSON responses were formatted (like in Firefox) instead of rendered as plain text. Plain text should remain as an option though.
Sample JSON: https://www.reddit.com/r/all.json
This is one of the reasons I have to sometimes switch to Firefox for my day-to-day work. I can't seem to get the JSON formatter chrome extensions to work, or the user scripts via tampermonkey etc.
I would love to also have the filtering functionality, plus header inspection if possible
This might be a stretch but is it possible that Firefox' implementation is actually a JS script? it generates a full DOM and everything
Vlad I think this might actually be it, in the Firefox source code
https://searchfox.org/mozilla-central/source/devtools/client/jsonview
jvacek I've tried built in JSON viewer from Firefox on https://raw.githubusercontent.com/json-iterator/test-data/master/large-file.json and it does not seem to work.
jvacek It shouldn't
Have you tried using extensions? This extension produces pretty output https://chrome.google.com/webstore/detail/json-lite/acacmjcicejlmjcheoklfdchempahoag
This one is not as pretty but will work even with giant json files (like the one above).
https://chrome.google.com/webstore/detail/ultra-fast-json-viewer/achlegaapdgcnnhfmliagapbampafine
The second one does not work for me in Orion. It pretty-prints the output, but doesn't do any collapsing or highlighting. Neither of them were able to load the large JSON file for me
ED: looks like the big file might work even with the firefox viewer maybe? Might also explain why the other ones don't format it
Shouldn't just JSON.stringify() be a good baseline for json outputs, though?
Highlighting and such can come later?
Something like document.body.firstChild.innerHTML = JSON.stringify(JSON.parse(document.body.firstChild.innerHTML), null, 4)
probably suffices, at least to me.
tiw In the meantime consider making a bookmarklet out of it
https://mrcoles.com/bookmarklet/
in addition this extension also works
https://chrome.google.com/webstore/detail/ultra-fast-json-viewer/achlegaapdgcnnhfmliagapbampafine
Want to note that this extension (a port of Firefox's JSON viewer) seems to work flawlessly (after disabling Orion's current JSON formatting). https://chrome.google.com/webstore/detail/json-viewer/efknglbfhoddmmfabeihlemgekhhnabb
I've tried it on a number of sites (including some larger JSON files) and haven't experienced any issues whatsoever.
Would love to see this viewer brought in as a built-in feature. The source for this port is here, and is MIT-licensed so could be used as the basis for an implementation in Orion: https://github.com/pd4d10/json-viewer
sanil When changes are proposed it is advisiable to create a new feature suggestion.
Can you test the performance of orion's build in json viewer and this on some larger json files like this https://raw.githubusercontent.com/json-iterator/test-data/master/large-file.json (because speed is our main consideration)