JSONView extension or any other extensions in the Chrome browser needs permission to access file URLs if it is accessing files from your local system. To allow:-
- Visit
chrome://extensions/ - Click on
Detailsbutton of the Extension card Switch ONtheAllow access to file URLs
JSONView extension or any other extensions in the Chrome browser needs permission to access file URLs if it is accessing files from your local system. To allow:-
- Visit
chrome://extensions/ - Click on
Detailsbutton of the Extension card Switch ONtheAllow access to file URLs
JSONView or any other json formatter detects if you are viewing json on basis on contentType of the document loaded (as set on http header).
Since you must be running this code on client side (browser) the contentType is set to text/html .
For the plugin to correctly format the json, it must know that what you're looking at is indeed json and it does so by reading contentType header.
That is why fetching json via this script shows json as text in body attribute but not picked up by the plugin.
In Chrome use JSONView or Firefox use JSONView
If you don't want to install extensions, you can simply prepend the URL with view-source:, e.g. view-source:http://content.dimestore.com/prod/survey_data/4535/4535.json. This usually works in Firefox and Chrome (will still offer to download the file however if Content-Disposition: attachment header is present).
Hey everyone I previously used this JSON Lite extension without any issues for 5+ years until upgrading to v117.0 today and it's stopped working, instead showing what looks like chrome's built in pretty-print. Any idea how to disable and use the extension? Thanks
JSONView for chrome
- In-browser viewer
- Expand and contract JSON items
- Format validation
- Doesn't require .json ending
Enable:
Chrome wrench button >> Tools >> Extensions >> "Allow access to file URLs"
I got impatient waiting for a new Chrome API and ported JSONView just using simple regex matching.
http://github.com/jamiew/jsonview-chrome
This is a rough draft, but it works! You can install it using "Load unpacked extension" from the chrome://extensions -- working out some kinks but will package it as a real extension soon.
For further prettification checkout the "XML Tree" extension (SuperUser won't let me post 2 links yet)