有没有办法自定义 Firebug 的键盘快捷键?我喜欢能够使用 Firebug 的Script面板单步执行 JavaScript 代码,但看起来我仅限于使用默认键盘快捷键来单步执行/进入/退出代码或使用鼠标单击相应的按钮。
我错过了什么吗?
Firefox/Firebug 中的config hack是否有一些秘密可以帮助我?
有没有办法自定义 Firebug 的键盘快捷键?我喜欢能够使用 Firebug 的Script面板单步执行 JavaScript 代码,但看起来我仅限于使用默认键盘快捷键来单步执行/进入/退出代码或使用鼠标单击相应的按钮。
我错过了什么吗?
Firefox/Firebug 中的config hack是否有一些秘密可以帮助我?
您可以手动更改它们。转到此目录:
在最近的版本中,扩展名包含在一个扩展名为 XPI 的文件中。只需将其重命名为 ZIP,创建一个目录并将其内容提取到其中。
Linux:
.mozilla/firefox/*****.default/extensions/firebug@software.joehewitt.com/
视窗:
%APPDATA%\Mozilla\Firefox\Profiles\<profile>\extensions\firebug@software.joehewitt.com\
然后修改这个文件(这些是我的重映射设置):
内容/firebug/debugger/script/scriptPanel.js (Firebug 2.0)
this.keyListeners =
[
chrome.keyCodeListen("F5", Events.isShift, Obj.bind(this.rerun, this, context), true),
chrome.keyCodeListen("F5", null, Obj.bind(this.resume, this, context), true),
chrome.keyCodeListen("F6", null, Obj.bind(this.stepOver, this, context), true),
chrome.keyCodeListen("F7", null, Obj.bind(this.stepInto, this, context)),
chrome.keyCodeListen("F8", null, Obj.bind(this.stepOut, this, context))
];
content/firebug/js/scriptPanel.js(Firebug 2.0 之前)
this.keyListeners =
[
chrome.keyCodeListen("F5", null, Obj.bind(this.resume, this, context), true),
chrome.keyListen("/", Events.isControl, Obj.bind(this.resume, this, context)),
chrome.keyCodeListen("F6", null, Obj.bind(this.stepOver, this, context), true),
chrome.keyListen("'", Events.isControl, Obj.bind(this.stepOver, this, context)),
chrome.keyCodeListen("F7", null, Obj.bind(this.stepInto, this, context)),
chrome.keyListen(";", Events.isControl, Obj.bind(this.stepInto, this, context)),
chrome.keyCodeListen("F8", null, Obj.bind(this.stepOut, this, context)),
chrome.keyListen(",", Events.isControlShift, Obj.bind(this.stepOut, this, context))
];
在 2.0 之前的版本中,您还应该更改本地化文件,因此工具提示应该是正确的键:
语言环境/en-US/firebug.properties
firebug.Continue=Continue (F5)
firebug.StepOver=Step Over (F6)
firebug.StepInto=Step Into (F7)
firebug.StepOut=Step Out (F8)
仅此而已。不幸的是,每次更新 Firebug 时都必须这样做。虽然已经有一个请求允许他们直接在 Firebug 中进行自定义。
正如@VonC 提到的,对此有一张公开票。根据我的经验,keyconfig 不适用于此目的。我确实编写了一个补丁,允许在 about:config 中自定义调试器执行控制键。如果您不想等待它被上游接受,和/或您不想自己构建它,我还发布了一个带有此修复的 XPI。
另一种选择是在文件中手动配置快捷方式
%APPDATA%\Mozilla\Firefox\Profiles\<profile>\extensions\firebug@software.joehewitt.com\content\firebug\browserOverlay.xul
例如,我通过注释相应部分删除了 F12 上的快捷方式,因为它与Tab Mix Plus的Undo Closed Tab快捷方式冲突。
缺点:Firebug 的更新会覆盖修改后的配置。
虽然可以在 Firebug 的源代码中更改快捷方式,但还有一种方法可以为这些操作添加不同的键,而无需触及源代码。
为此,您必须安装一个扩展程序,它允许您定义自定义快捷方式,例如Dorando keyconfig。
为该扩展执行的步骤:
澄清截图:
* 那就是oncommand
属性的值。因此,如果要添加恢复 JavaScript 执行的快捷方式,则需要Firebug.Debugger.resume(Firebug.currentContext)
从cmd_firebug_resumeExecution
命令中复制。