有没有办法自定义Firebug的键盘快捷键?

时间:2008-11-06 07:56:12

标签: debugging firefox keyboard-shortcuts firebug

有没有办法自定义Firebug的键盘快捷键?我喜欢能够使用Firebug的 Script 面板逐步执行JavaScript代码,但看起来我只能使用默认的键盘快捷键来踩/进/出代码或使用鼠标来单击相应的按钮。

我错过了什么吗?

在Firefox / Firebug中是否有一些秘密的关于:config hack会对我有帮助吗?

5 个答案:

答案 0 :(得分:7)

您可以手动更改它们。转到此目录:

在最新版本中,扩展程序位于单个文件中,扩展名为XPI。只需将其重命名为ZIP,创建一个目录并将其内容提取到其中。

Linux的:

.mozilla/firefox/*****.default/extensions/firebug@software.joehewitt.com/ 

视窗:

%APPDATA%\Mozilla\Firefox\Profiles\<profile>\extensions\firebug@software.joehewitt.com\

然后修改此文件(这些是我的重新映射设置):

content / 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时都必须这样做。虽然已经有request to allow their customization directly within Firebug

答案 1 :(得分:6)

正如discussion forum中所述,您可以尝试keyconfig ...否则,它是known bug/limitation

答案 2 :(得分:2)

正如@VonC所提到的,这是一张开放票。根据我的经验,keyconfig不能用于此目的。我做了write a patch,它允许在about:config中自定义调试器执行控制键。如果您不想等待它被上游接受,并且/或者您不想自己构建它,我还发布了带有此修复程序的XPI。

答案 3 :(得分:1)

另一种选择是在文件

中手动配置快捷方式
%APPDATA%\Mozilla\Firefox\Profiles\<profile>\extensions\firebug@software.joehewitt.com\content\firebug\browserOverlay.xul

例如,我通过注释相应的部分删除了F12上的快捷方式,因为它与Tab Mix Plus的撤消已关闭选项卡快捷方式冲突。

缺点:Firebug的更新将覆盖修改后的配置。

答案 4 :(得分:0)

虽然可以change the shortcuts within Firebug's source code,但还有一种方法可以在不触及源的情况下为这些操作添加不同的键。

为此,您必须安装扩展程序,以便您定义Dorando keyconfig等自定义快捷方式。

为该扩展程序执行的步骤:

  1. 转到附加组件管理器。
  2. 单击扩展程序旁边的选项按钮以打开自定义对话框。
  3. 单击添加新密钥按钮以打开密钥编辑器。
  4. 为快捷方式指定正确的名称
  5. code related to the action *粘贴到代码字段中。
  6. 点击确定
  7. 点击快捷方式栏位
  8. 通过按键盘上的按键添加自定义快捷方式
  9. 点击应用按钮
  10. 屏幕截图:

    Dorando keyconfig key customization dialog Dorando keyconfig key editor

    *这是oncommand属性的值。因此,如果要添加用于恢复JavaScript执行的快捷方式,则需要从Firebug.Debugger.resume(Firebug.currentContext)命令复制cmd_firebug_resumeExecution

相关问题