可以在delete console
Google Chrome版本:46.0.2490.80 m
在以前的版本中,此命令恢复原始控制台,但现在我收到消息:
未捕获的ReferenceError:未定义控制台
答案 0 :(得分:1)
嗯,这很容易,而且已经被问到了:
function healConsole() {
//<iframe> element
var iframe = document.createElement("iframe");
//Hide it somewhere
iframe.style.position="fixed";
iframe.style.height = iframe.style.width = "1px";
iframe.style.top = iframe.style.left = "-5px";
//No src to prevent loading some data
iframe.src = "about: blank";
//Needs append to work
document.body.appendChild(iframe);
//Get the inner console
window.console = iframe.contentWindow.console;
}
最初在这里问:Get access to the console once the console object reference was changed