When I visit some website(such as: https://www.baidu.com) and open browser dev tool, I found they have redefined function "document.write" as:
document.write
//output: ƒ (){}
yes, they have replaced "document.write" with a "blank" function.
So my question is: how can I recover "document.write" to original function?
As per baidu javascript code document.write is rewritten with empty function. In code it's written as document.write = document.writeln = function() {}
document is instance of Document, we can assign Document.prototype.write to document.write it'll update function to its default. Below is the sample code snippet to override function to use it's default standard
document.write = Document.prototype.write
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