Sections
Sub-Sections
Start Page
Index
History
Last Change
Download
Plain Text
Metanav
Preferences
About Trac
Links
Slowchop Studios
Gerald Kaszuba
Advertisement

Human Readable JSON Greasemonkey Script

About

Formats JSON responses in Firefox to be quicker and easier to read by a human.

For the script, I borrowed and slightly modified a pretty print script which was borrowed from the JSON web site.

Example

This JSON string

{"key": "value", "array": [1,2,3,"moo"]}

would be converted to:

{
    "key": "value",
    "array": [
        1,
        2,
        3,
        "moo"
    ]
}

Usage

  1. To use this you will need to install the Greasemonkey Firefox Add-on.
  1. Install the script using the Download link below.
  1. Once installed, make sure your configure your "Included Pages" in the Greasemonkey configuration to point to URLs with expected JSON output. For example: http://myjsonserver.com*

Notes

  • The content-type can't be text/html -- it won't render correctly.
  • Trying this script on a page that isn't JSON text may do strange things or just throw a JavaScript error.

Download