Previewing command line JSON output using firefox
Firefox, like other modern browsers, has an excellent in-built JSON viewer. It also supports Data URIs which allows you to load HTML resource from text in URL as if they were external resources. We can make use of these two features to have a handy JSON previewer which can be invoked from command line.
For example, when you enter the below link into your browser, it opens a “Hello world” text document.
data:,Hello%2C%20World!
This content is not limited to plain text. It can even be an HTML document:
data:text/html,%3Ch1%3EHello%2C%20World!%3C%2Fh1%3E