Showing posts with label Firefox. Show all posts
Showing posts with label Firefox. Show all posts

Tuesday, July 1, 2008

Change Shortcut Key for Firefox Download Manager

Firefox is officially supported by Peoplesoft PIA, and it works fine most of the time. But advanced users may have found they were stuck when trying to invoke system info screen - they hit CTRL-J in FF as they did in IE but saw no system info appeared. Instead, FF popped up a download manager window.

The reason is simple: CTRL-J is being used by FF as a shortcut key for download manager. And unfortunately, FF is not shipping a direct way for user to customize those keys. 'about:config' doesn't enable you to do that.

But there are still ways to tweak it:

1) With add-on. An unofficial FF add-on, 'keyconfig', is available at
http://forums.mozillazine.org/viewtopic.php?t=72994. With that you are free to customize shortcut keys for FF, provided you know how to manually edit FF's user preference file (perfs.js). If you can't or don't want, install one more add-on, 'functions for keyconfig' from http://www.pqrs.org/tekezo/firefox/extensions/functions_for_keyconfig/index.html. This enables you to change keys through UI.

2) Without add-on. Knowing where to get a tool is good, but doing it w/o a tool is cool, right?


Let's look at how FF launches download manager first. Explorer %FIREFOX_HOME%\chrome, find the following 2 files:

  • browser.jar
  • en-US.jar

Unjar browser.jar into %TEMP%, find browser.xul from extracted files and open it in your text editor, you see a line that looks like

  • <menuitem id="menu_openDownloads" label="&downloads.label;" key="key_openDownloads" accesskey="&downloads.accesskey;" command="Tools:Downloads"/>
Note the highlighted 'key' attribute, this obviously defines a shortcut key for download manager menu. Remove it to disable the key.

But what if you only want to change the shortcut key rather than disabling it? Let's look at how "key_openDownloads" is defined. In the same browser.xul, you see

  • <key id="key_openDownloads" key="&downloads.commandkey;" command="Tools:Downloads" modifiers="accel"/>
The highlighted attribute denotes the key value, but how do we know what "&downloads.commandKey;" actually is?

Now extract en-US.jar into %TEMP%, find browser.dtd in which you see

  • <!ENTITY downloads.commandkey "j">
The truth is out there!. Change 'j' to whatever you prefer, but make sure the new key doesn't conflict with other FF shortcuts.

Stuff the modified browser.xul or/and browser.dtd back into the jar files. Open FF and see whether it works.

This tip applies to both FireFox 2 and 3.