Created
May 23, 2017 20:02
-
-
Save cowlicks/a3bc662b38c36483b35f74b2b54e37c0 to your computer and use it in GitHub Desktop.
Get restore `console.log` on pages where it has been removed (like twitter) by pulling it out of an iframe.
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 setConsole() { | |
var iframe = document.createElement('iframe'); | |
iframe.style.display = 'none'; | |
document.body.appendChild(iframe); | |
console = iframe.contentWindow.console; | |
window.console = console; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment