Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Override document.write
(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