For some reason I seem unable to use JSON.stringify on a DOMWindow object. For example:
console.log(window.self); // Outputs a hierarchical DOMWindow object
console.log(JSON.stringify(window.self)); // Outputs nothing - not even an error
alert(window.self); // Alerts "[object DOMWindow]"
alert(JSON.stringify(window.self)); // Again nothing - not even an error
Tested on Safari and Chrome. Does anyone have any ideas how I can achieve this?
Edit:
Moved edit to a new question as it's not really specific to this.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…