JOURNAL.ROBBI.MY
← Back to Posts

Beautify `JSON` on web browser without addons

article 1 min read

Hi everyone! Nowadays, most of developers use a notation on data structure representation that called as JSON.

The nested and super-long single or multilines key/values, it will be a great pleasure if the JSON are well formatted and beautify for easy reading by human.

Unfortunately, some company are blocking their user from installing addons. Which make it someone who need to read the JSON data, for example whom work as developer over there.

But do-not worry, I have a trick for this situation. First, you need to create new bookmarks on your browser and add this one line javascript code below as URL.

javascript
javascript:(function(){document.body.innerHTML=JSON.stringify(JSON.parse(document.body.textContent), null, 4);document.body.style='white-space: pre;font-family:monospace';})()

Now, when you open an API that are clunky and not well format, all you need todo is press the bookmark that we just created before.

The bookmarks will beautify the javascript and you now can read the JSON earsier from here 🌸

Have some thoughts, discussion or feedback on this post?

▸ What is webmention? How to send interactions!
Below you can find all of webmention with this page. You can also mention this URL on any website that supports WebMention. Have you written a response to this post? Let me know the URL:

Don't have WebMention? Use Comment Parade!

No webmentions yet.

Comments section coming soon. For now, send a webmention or email.