Displaying JSON in your browser

JSON, the JavaScript Object Notation, is used when communicating between web server and web application. Following, you get an insight how to modify your browser to properly display JSON.

Inspecting JSON is part of the developer’s day, and there are some obstacles you have to overcome:

  • Browsers by default only display JSON as a plain text string, making it near to impossible to make sense of complex json files
  • When using custom MIME types – vendor specific ones, e.g. application/vnd.foo+json – most JSON formatter addons/extensions do not detect that the data is JSON and thus do not highlight them.

This post shows you what to do to get pretty JSON with custom MIME types:

Chromium

JSONView pretty prints JSON, but falls short when you have custom MIME types. To get around that problem, you need to install application/…+json|+xml as inline – it prevents Chromium from downloading all +json and +xml MIME types.

No further configuration needed.

Firefox

JSONovich displays JSON properly and has in-built support for custom MIME types:

  • Open the addon list
  • JSONovich preferences
  • MIME types: Add…

That’s all needed.

Opera

JsonViewer highlights JSON, but Opera still asks you to download the file instead of displaying it.

You need to configure Opera to show the specific MIME type:

  • Open Preferences
  • Advanced
  • Downloads
  • Add a new one and activate „Open in Opera“

 

Diesen Artikel kommentieren

Autor
Dies ist nur ein Gravatar
Christian Weiske
Archiv
August 2016
M D M D F S S
   
1234567
891011121314
15161718192021
22232425262728
293031  
Letzte Kommentare