Update: Custom Keys on Firefox

Linux

Update 3/14/08 I’m an idiot (or I just don’t like restarting my machine) The keyconfig addon will not work when Firefox updates UNTIL you restart your machine.  You can still hack the source if you want but restarting your machine is probably easier.  Update 3/3/08 FireFox 2.0.0.12 – keyconfig won’t install – may need to restart machine to get this working again.  Also, below method no longer works for editing keybindings see http://www.mozilla.org/unix/customizing.html#keys for more/better info.So I posted about keyconfig, a nice little add-on for FF that allowed you to rebind keys. I loved this because I refresh the browser almost more times a day than I breath. So for me I just added ALT+Q to the list of what refreshes the page so I can alt-tab from gedit into FF and refresh the page by moving only my index finger.So FF updated today to 2.0.0.0.0.0.9…or whatever version and it appears it broke keyconfig. Shit.Update 12/4/07: Keyconfig is working again in FF 2.0.0.10 (ubuntu linux gutsy) …you can still custom bind keys the hard way I describe below:After a little exploring and tinkering I found a relatively easy way to rebind or bind new keys to browser actions.You must dig around in FF source code – which is scary yes so always make a backup and only do this if you have source code tinkering experience…or like to break stuff like me.You’ll find the key binding section of FireFox in the browser.xul file…for windows folks…good luck I haven’t tried it yet in Vista.This lives on my *nix system in /usr/share/firefox/chrome/browser/content/browser. I open this from the command line using sudo so we can modify the contents.$sudo gedit /usr/share/firefox/chrome/browser/content/browser/browser.xulMake a backup.Now.Ok, you’ve made your backup! Let’s look at the guts.Scroll down to line 250ish. You’ll see stuff like:<key id="goForwardKb2" key="&goForwardCmd.commandKey;" command="Browser:Forward" modifiers="accel"/><key key="&reloadCmd.commandkey;" command="Browser:ReloadSkipCache" modifiers="accel,shift"/>we’re interested in the second <key> tag for this example. So I want Q and ALT to refresh the page…so as luck has it our key=”q”, the command stays the same (if you want to skip the cache) and modifers is…Bueller, Bueller? Yes modifers=”alt”For the lazy cut and paste:<key key="q" command="Browser:ReloadSkipCache" modifiers="alt"/>That’s it save it and restart the fox!Reference:http://www.mozilla.org/unix/customizing.html#keys

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s