Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 302
Dan Esparza Avatar asked Nov 06 '08 07:11

Dan Esparza


People also ask

How do I change hotkeys in Windows 11?

Select the Start button, and then select Microsoft Mouse and Keyboard Center. From the displayed list of key names, select the key that you want to reassign. In the command list of the key that you want to reassign, select a command.


4 Answers

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/[email protected]/ 

Windows:

%APPDATA%\Mozilla\Firefox\Profiles\<profile>\extensions\[email protected]\

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.

like image 181
lepe Avatar answered Oct 05 '22 19:10

lepe


As stated in their discussion forum, you can try keyconfig... otherwise, it is a known bug/limitation.

like image 32
VonC Avatar answered Oct 05 '22 21:10

VonC


As @VonC mentioned, there is an open ticket on this. In my experience, keyconfig doesn't work for this purpose. I did write a patch that allows for the debugger execution control keys to be customized in about:config. I have also posted an XPI with this fix if you don't want to wait for it to be accepted upstream, and/or you don't want to build it yourself.

like image 23
pkaeding Avatar answered Oct 05 '22 21:10

pkaeding


Another option would be to configure the shortcuts manually in file

%APPDATA%\Mozilla\Firefox\Profiles\<profile>\extensions\[email protected]\content\firebug\browserOverlay.xul

For example, I removed the shortcut on F12 by commenting the corresponding section because it conflicts with the Undo Closed Tab shortcut of Tab Mix Plus.

Disadvantage: An update of Firebug will overwrite the modified configuration.

like image 29
Dirk Vollmar Avatar answered Oct 05 '22 21:10

Dirk Vollmar