Twitter’s website does something like
console.log = function () {};
to turn the browsers’ built-in console.log
method into a no-op. Is there I way to restore the original function?
Unless they also removed it in the prototype, getting the log
method using getPrototypeOf()
should work:
console.log = Object.getPrototypeOf(console).log;
Since using console.log = function() {}
overrides, but doesn't remove the one defined in the prototype, you can delete the overriding method:
delete console.log
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With