如何调用Chrome实现的原始' console.log ',如果它已被用户的脚本覆盖

How to call original `console.log` that Chrome implements if it has been overriden by user's script?

本文关键字:如果 覆盖 脚本 用户 log console 实现 Chrome 原始 何调用 调用      更新时间:2023-09-26

我正在Chrome的开发人员工具(F12)中调试一个网站,该网站的程序员已经为自己的目的重新实现了console.log。在他们的代码中,他们基本上是这样做的:

`console.log = function () { new code that has nothing to do with logging to console }`

当我调用console.log时,它不记录到控制台。

我的问题是-我如何调用浏览器实现的原始console.log而不是覆盖的版本?

我无法访问网站的代码或其程序员。

你需要旧的实现吗??

如果不是最简单的就是删除旧的实现

delete console.log;

将自动恢复为默认操作