I need to beautify an existing view through a userscript (TamperMonkey). The code works in JSFiddle (see http://jsfiddle.net/2phrogm5/), but not where I need it: inside the Zabbix web interface.
To replicate the issue:
- open the public demo
- press F12 to open the Developer Tools
- insert
JSON.stringify({"asd": {"asd": 3}}, null, 4)
Expected result:
"{
"asd": {
"asd": 3
}
}"
My output:
"{"asd":{"asd":3}}"
The issue doesn't exist using Developer Tools on https://stackoverflow.com/.
I already tried the solution provided in JSON.stringify() array bizarreness with Prototype.js, with no success.