callumlocke / json-formatter

Makes JSON easy to read.
https://chrome.google.com/webstore/detail/json-formatter/bcjindcccaagfpapjjmafapmmgkkhgoa?hl=en
BSD 3-Clause "New" or "Revised" License
3.76k stars 859 forks source link

Adding button to inject window.json value #249

Open IzzleNizzle opened 1 year ago

IzzleNizzle commented 1 year ago

This PR add's a button to the option bar that adds the value of the JSON to the global variable window.json as per the docs approach:

json = JSON.parse(document.getElementById("jsonFormatterRaw").querySelector("pre").innerText)

Attempted resolve of #231

Related unresolved PR: https://github.com/callumlocke/json-formatter/pull/242

Inspiration https://github.com/callumlocke/json-formatter/issues/231#issuecomment-1521730777

image

c4ldas commented 10 months ago

I have just tried and it worked nice, thanks! Hope that is available in the official version!

JohnRDOrazio commented 4 months ago

👍 to pulling this into a new release