似乎没有办法关闭 Firebug 时间戳日志。解决此问题的一种方法是自己编辑代码并删除此功能:
将扩展解压到 Mozilla Firefox 配置文件中的目录:
将目录更改为您的 Firefox 配置文件扩展目录。在 Ubuntu 上,这将是这样的:
cd ~/.mozilla/firefox/{random-string}/extensions/
Firebug 扩展由 标识firebug@software.joehewitt.com.xpi
。创建一个同名但没有 .xpi 的新目录,并将 XPI 移动到该目录中:
mkdir firebug@software.joehewitt.com
mv firebug@software.joehewitt.com.xpi firebug@software.joehewitt.com
接下来,将目录更改为新创建的 Firebug 目录,然后解压缩扩展:
cd firebug@software.joehewitt.com
unzip firebug@software.joehewitt.com.xpi
所有文件都应该被解压,以便扩展的目录位于当前目录中。您的文件结构将如下所示:
$: ~/.mozilla/firefox/{random-string}/extensions/firebug@software.joehewitt.com$ l
chrome.manifest defaults/ firebug@software.joehewitt.com.xpi install.rdf locale/ skin/
content/ docs/ icons/ license.txt modules/
$: ~/.mozilla/firefox/ghlfe0bb.ff5.0/extensions/firebug@software.joehewitt.com$
在文本编辑器中打开 consoleExposed.js:
接下来,切换到content/firebug/console
目录:
cd content/firebug/console
consoleExposed.js
使用您喜欢的编辑器编辑文件:
vim consoleExposed.js
禁用控制台.timeStamp:
在第 215 行或附近,您将看到以下函数:
console.timeStamp = function(label)
{
label = label || "";
if (FBTrace.DBG_CONSOLE)
FBTrace.sysout("consoleExposed.timeStamp; " + label);
var now = new Date();
Firebug.NetMonitor.addTimeStamp(context, now.getTime(), label);
var formattedTime = now.getHours() + ":" + now.getMinutes() + ":" +
now.getSeconds() + "." + now.getMilliseconds();
return logFormatted([formattedTime, label], "timeStamp");
};
在第一个花括号之后,强制函数不返回任何内容:
console.timeStamp = function(label)
{ return ; // disable timestamp by returning
label = label || "";
if (FBTrace.DBG_CONSOLE)
重启 Firefox,享受没有时间戳的世界:
编辑后,重新启动 Firebug。您不应再在控制台中看到 timeStamp 的日志消息。