Changeset 12 for human-readable-json
- Timestamp:
- 29/08/07 22:22:42 (17 months ago)
- Files:
-
- 1 modified
-
human-readable-json/human-readable-json.user.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
human-readable-json/human-readable-json.user.js
r11 r12 1 // Human Readable JSON Greasemonkey Script v0.1. 01 // Human Readable JSON Greasemonkey Script v0.1.1 2 2 // Copyright 2007 Gerald Kaszuba 3 3 // Released under the GPL license … … 151 151 'load', 152 152 function() { 153 jsonTag = document.getElementsByTagName('pre')[0] 154 jsonText = jsonTag.textContent; 155 jsonObj = jsonText.parseJSON(); 156 prettyJson = jsonObj.toJSONString(true); 157 jsonTag.textContent = prettyJson; 153 jsonTag = document.getElementsByTagName('pre')[0]; 154 if (!jsonTag) return; 155 jsonText = jsonTag.textContent; 156 jsonObj = jsonText.parseJSON(); 157 prettyJson = jsonObj.toJSONString(true); 158 jsonTag.textContent = prettyJson; 158 159 }, 159 160 true); 160 161 162 // vim: ts=4 sw=4 expandtab