Last active
August 29, 2020 04:51
-
-
Save mpjura/485e9edcac3bc2fa85ac to your computer and use it in GitHub Desktop.
Override document.write
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var old = document.write; | |
document.write = function( content ) { | |
if ( "interactive" === document.readyState ) { | |
console.log("document.write called after page load: ", content ); | |
// optional.. safely append the content | |
// document.body.appendChild( content ); | |
return; | |
} | |
old.call( document, content ); | |
}; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment