stenington/webxray — comment on commit 12731e4c270d4b472737bbaeb2f909e34e61bbbb
File:  line 0
By toolness:

This is good, but two concerns:

* Could you put the restoration in a `try` block so that even if an exception is raised by `JSON.stringify`, the old `Array.prototype.toJSON` is restored? I'm not actually sure what kinds of errors might result from `JSON.stringify()` but it feels like the safe thing to do. Let me know if you disagree, though!

* Do you think you could look for other occurrences of `JSON.stringify` in the `src` directory (i.e., JS that's part of `webxray.js`) and change those too? This also seems like the safe thing to do, since it's very hard to detect where/when things might explode... But let me know if you disagree with this too.

FWIW, another thing we can do is actually redeclare JSON in `src/intro.js`, so that any calls to `JSON.stringify` within the goggles bookmarklet automatically call our safe version... This would relieve us from having to remember to always call `jQuery.safeJSONStringify()` and wouldn't disrupt the behavior of the containing page. What do you think?