[英]Chrome “delete console” - how to restore it?
之后可以恢复chrome控制台: delete console
谷歌浏览器版本:46.0.2490.80米
在以前的版本中,此命令还原原始控制台,但现在我收到消息:
未捕获的ReferenceError:未定义控制台
嗯,这很容易,而且已经被问到:
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;
}
最初在此处询问: 更改控制台对象引用后,可以访问控制台
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.