Is it possible to somehow access to console.log after it gets overwritten?
window.console = { log: function (msg) { alert(msg); }, /* etc... */ };
Would be it be possible to regain the original console.log functionality?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can back up the console before overwriting it.
Then you can use the
oldConsolevariable.If you can’t back it up, you can create an iFrame, and then steal the console from there (this may not work in all browsers):
Demo: http://jsfiddle.net/jcG7E/2