[英]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.