Skip to content

Instantly share code, notes, and snippets.

@cowlicks
Created May 23, 2017 20:02
Get restore `console.log` on pages where it has been removed (like twitter) by pulling it out of an iframe.
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