Firefox 53: JSON Viewer on by default
Mozilla plans to enable the built-in JSON Viewer of the Firefox web browser for all browser channels including Firefox Stable in Firefox 53.
The organization integrated the viewer in version 44 of the web browser, but did not enable it by default for all channels but the Developer Channel.
Firefox's JSON Viewer displays structured JSON data instead of the RAW data dump that one gets when the viewer or a third-party extension is not enabled.
Take a look at the following two screenshots to see the difference between unstructured JSON data, barely readable by humans, and the data presented by the JSON Viewer in Firefox.
As you can see, the data is displayed in a tree hierarchy with JSON Viewer enabled. It is still possible to switch to the raw data view with the viewer enabled. Other options that you may find interesting are to show or hide certain bits of data, to use a filter, and to save or copy data.
This is mostly useful for developers, as it provides them with a better representation of JSON data directly in the Firefox web browser. Useful for instance to understand how to retrieve information from the data.
JSON Viewer is part of all versions of Firefox already, but it is not enabled in all versions. While it is enabled in Firefox Developer Edition and Nightly for instance, it is not enabled in Firefox Stable. This will happen with the release of Firefox 53 which will come out on April 18th, 2017 if the Firefox release schedule is not changed.
You can enable JSON Viewer in all versions of Firefox right now if you don't want to wait for that to happen:
- Type about:config in the Firefox address bar and hit the Enter-key.
- Confirm that you will be careful if the warning prompt appears.
- Search for devtools.jsonview.enabled.
- Double-click on the preference name.
Setting the value of the preference to true enables the feature, while a value of false disables it. This means that you can disable the viewer in case you don't require it, or prefer to use a different extension or program for that instead.
You can follow the progress on Bugzilla. (via Sören Hentzschel)
this online json viewer is good
https://www.jsonformatting.com/
Hey Martin
Thanks for this.
As I’m stuck on 56 at work due to Mozilla butchering their add-on API, I should have had this enabled already but for some unknown reason, it wasn’t.
Very helpful to find your about:config reference.
Ghacks rocks!
My otherwise validated JSON document triggers this error message in FFJsonViewer:
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
Viewing raw data reveals the presence of a couple of little question marks at the beginning of the raw file, which are not there in my text editor.
Ideas of what’s going on? Thanks.
Could JSON Viewer be applied manually for responses with incorrect content-type?
Using it for weeks now, it’s very nice to have it.
Before that I had to copy json to notepad++ and prettyprint it there.
I don’t know about you guys, nor what the fuss is all about, but Notepad++ opens a very readable json file
How do you get Notepad++ to automatically open JSON files in a very readable format?
> I’ve just switched it to true, here on Firefox 50.1.0 but all I get of a json file is its raw display, no means to get the structured view of the data.
Works for me on Firefox 50.1. Of course Firefox has to know that the server response is JSON. That means the server has to send the correct response header (content-type).
> Also, as I understand the article, this built-in JASON viewer has, will have no editing feature, is this correct?
Yes, that’s correct. A editing feature does not make a lot of sense because it’s ja JSON *viewer* – another view for the json response from a server. You can’t edit the response from a server.
I answered above, Sören, because I got your reply via email before it was published.
But I do have medium capacities, except with Flash :)
I thought I knew the components of Firefox relatively well, yet I knew nothing of the availability of the devtools.jsonview.enabled setting.
I’ve just switched it to true, here on Firefox 50.1.0 but all I get of a json file is its raw display, no means to get the structured view of the data. Perhaps, Martin,is the screenshot displayed in your article taken on a Firefox nightly build? Also, as I understand the article, this built-in JASON viewer has, will have no editing feature, is this correct?
Up to nowI call upon the ‘JSON Editor Online’ at http://www.jsoneditoronline.org/ to view and edit json files. It’s well done, opens the file structures, allows search/edit, allows to compavt it back before saving : for whom may be interested.
Looking forwards for Firefox’s built-in JSON viewer, especially with editing capacity.
Solitude, when you answer yourself. Not really, considering I have telepathy powers and that I see an answer from Sören Hentzschel stating that the built-in Firefox JSON viewer works fine on his FF 50.1 (with of course devtools.jsonview.enabled set to true), adding “Of course Firefox has to know that the server response is JSON. That means the server has to send the correct response header.”.
Well, I tested with a local JSON file. But if Firefox’s built-in PDF viewer reads local PDFs why wouldn’t the JSON viewer read local JSON files as well?
I see no more … everything blur now, losing my power …. :)
It works here with Firefox 50.1. Maybe it’s one of your add-ons that’s messing it up ? Or Firefox 64-bit ?
People who want to try out can check this JSON file : http://live-menu.staugustinesvancouver.com/taps.json
It’s pretty neat. (Grabbed the link from the Mozilla bug, comment 10.)
From this add-on’s page:
“If you need to unblock some elements
You can customize the settings in the add-on preferences. about:addons”
I don’t know what the JSON viewer needs though. But if you can read PDF, which I think needs some resource: things too (?), then you may have the option to ask the author to let JSON viewer access what it needs or something.
@Jason, the culprit was indeed the ‘No Resource URI Leak’ Firefox add-on. Disabling it enabled your link to display the structured view.
I’d rather keep ”No Resource URI Leak'” I guess.
Thanks.
I’ve tested JSON on the link you provide : raw only. I’ve also set both hereafter to true and also restarted FF:
extensions.bookmarkfaviconchanger.embedFaviconInJSON
devtools.netmonitor.har.jsonp
I’m running FF 50.1 64-BIT
I think I know what my issue may be, that of an add-on called ‘No Resource URI Leak’- Investigating.
Anybody knows how open the *.jsonlz4 files?
Have a look here.
Why would the average Firefox user need something like this?
And why would the average user need “view source” or view cache ? I’m fucking glad people have the option to look around and eventually educate themselves without first having to break walled gardens of knowledge and tooling.
It’s also a commodity. I still mourn the add-on Cache Viewer to this day, and it died in what, Firefox 3 ?
Finally, developer tools are all included in Firefox release, so why not this one ? I shrug at your thought process, sir, I shrug at it, that’s what I do.
About JSON files : I have the use of not only a JSON viewer but also editor, i.e when cleaning Firefox’s xulstore.json file in my user’s profile when an add-on removal left traces in that file (seldom). This is why I consider a viewer is fine but an editor as well is better. But as far as a browser is concerned what is, IMO, essential are viewers when specific viewers are required to read specific formats found online, far more than images and videos. I appreciate the built-in PDF viewer, HTML5, anything which allows a browser to emancipate from 3-rd party tools when it comes to accessing, viewing, hearing a site’s content. Edition itself is not, IMO, related to the fundamentals of a browser.
About a Cache Viewer add-on for Firefox : there have been and remain several. The one I use is totally functional here on Firefox 50.1.0 64-BIT :
CacheViewer at https://addons.mozilla.org/en-US/firefox/addon/cacheviewer/
I have the same question…