在Google Chrome中清除JavaScript控制台

我想知道是否可以使用某些命令清除控制台。

console.log(),可以打印…是否有清除控制台的命令?

我试着在console.log(console);下面得到这个功能…

assert: function assert() { [native code] }

constructor: function Console() { [native code] }

count: function count() { [native code] }

debug: function debug() { [native code] }

dir: function dir() { [native code] }

dirxml: function dirxml() { [native code] }

error: function error() { [native code] }

group: function group() { [native code] }

groupEnd: function groupEnd() { [native code] }

info: function info() { [native code] }

log: function log() { [native code] }

markTimeline: function markTimeline() { [native code] }

profile: function profile() { [native code] }

profileEnd: function profileEnd() { [native code] }

time: function time() { [native code] }

timeEnd: function timeEnd() { [native code] }

trace: function trace() { [native code] }

warn: function warn() { [native code] }

__proto__: Object

[我想没有办法清理控制台…但是我想让别人对我说…]

回答:

更新:截至2012年11月6日,console.clear()是现在可以在Chrome金丝雀。


如果您键入clear()控制台,它将清除它。

我认为没有办法以编程方式进行此操作,因为它可能会被滥用。(控制台已通过某些网页清除,最终用户无法访问错误信息)

一种可能的解决方法:

在控制台类型中window.clear = clear,您将可以在页面上的任何脚本中使用clear。

以上是 在Google Chrome中清除JavaScript控制台 的全部内容, 来源链接: utcz.com/qa/422086.html

回到顶部