Search code examples
debuggingfirefoxkeyboard-shortcutsfirebug

Is there a way to customize Firebug's keyboard shortcuts?


Is there a way to customize Firebug's keyboard shortcuts? I love being able to step through JavaScript code using Firebug's Script panel, but it looks like I'm limited to either using the default keyboard shortcuts for stepping over/into/out of code or using the mouse to click the appropriate button.

Am I missing something?

Is there some secret about:config hack in Firefox/Firebug that would help me?


Solution

  • You can change them manually. Go to this directory:

    In recent versions the extension comes in a single file with the extension XPI. Just rename it to ZIP, create a directory and extract its contents into it.

    Linux:

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

    Windows:

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

    Then modify this file (these are my remapping settings):

    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 (before 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))
        ];
    

    In versions before 2.0 you should also change the localization file, so the tooltips should the correct keys:

    locale/en-US/firebug.properties

    firebug.Continue=Continue (F5)
    firebug.StepOver=Step Over (F6)
    firebug.StepInto=Step Into (F7)
    firebug.StepOut=Step Out (F8)
    

    And that is all. Unfortunately, you have to do it every time you update Firebug. Though there is already a request to allow their customization directly within Firebug.