XDebug helper & Firebug keyboard shortcuts
Tech Firebug Firefox PHP XDebug
2009-06-25

Firefox Xdebug

If you’re a developer who uses the XDebug PHP debugger, you probably already use a Firefox extension called XDebug Helper, which provides a convenient toggle switch for enabling debugging. You probably have Firebug installed too. Here is a method for setting up keyboard shortcuts to toggle them on and off (I use F1 & F2).

First, install the keyconfig Firefox extension (unfortunately it doesn’t have an official page). Click Tools -> Keyconfig… and you should get the following window:

Keyconfig screen

Changing the “Open Firebug” shortcut is easy: you should see it listed with a standard key binding of F12. Click it, type your new key into the edit box at the bottom of the window, and hit “apply”.

To toggle XDebug Helper, you need to click “Add a new key”. Fill out the popup window as follows:

Helper toggle

Click ok and it will be added to the list. Then you can set the key binding in the same way as you did for Firebug, I set mine to F2. Don’t forget to close and reopen Firefox. That’s it!

If you’re interested in setting up your own keyboard shortcuts for extensions that may not natively support them, here is the hack I used:

  1. Download the .xpi extension file, and extract it (it’s just a zip file).
  2. Look through the source code for the main.js file.
  3. Find the function you’d like to call and set up a new shortcut for it in keyconfig.