Tweaking Firefox
It’s a big day at the open source camp with the official release of Firefox 1.0. The mozilla web site is just pounded to the ground – it just won’t load like it should, making the downloading of the browser difficult. Bittorrent came in to rescue. The official torrent downloaded fast from the mozilla FTP site, and firefox installation file itself was downloaded in matter of seconds too.
Now, my quest started.
I love keyboard short cuts.
As a web developer, I loved having the Page Info (Tools -> Page Info) at my finger tip. In previous Firefox versions, I could use ctrl-J to access that info. As of version 0.9, ctrl-J was assigned to the Download window, and ctrl-I is the bookmarks (the compatibility issue with Internet Explorer). Installing Pithy extension resolved this problem. So far so good.
There was a period of time when I used Mozilla 1.7 browser. It also is a fine browser. One of the keyboard shortcut I liked was ctrl-Q to shut down Firefox completely. And this shortcut is missing in Firefox. I’ve been wondering if I could add this myself. I should be able to, since the entire user interface of all Mozilla based applications are defined in XUL.
I was just be able to figure this out today. Here is the detail. (And it’s not for the faint at heart)
- Find
chrome\chrome.rdffile inside Firefox installation folder - Open it in a text editor
- Find the section that looks like
c:baseURL="jar:resource:/chrome/browser.jar!/content/browser/" - Replace that line with
c:baseURL="resource:/chrome/browser/content/browser/" - Find the section that looks like
c:baseURL="jar:resource:/chrome/en-US.jar!/locale/browser/" - Replace that line with
c:baseURL="resource:/chrome/en-US/locale/browser/" - Save the file, and exit the text editor
- Find
chrome\browser.jarfile inside Firefox folder - Make a copy of the file, and name it
browser.zip - Unzip the content of the zip file to
browserfolder within the current location - Find
chrome\en-US.jarfile inside Firefox folder - Make a copy of the file, and name it
en-US.zip - Unzip the content of the zip file to
en-USfolder within the current location - Find
chrome\browser\content\browser\browser.xulfile within the Firefox folder – This is one of the files that was just unzipped - Open the file in a text editor
- Find the section that looks like
<key id="key_SwitchTextDirection" key="&bidiSwitchTextDirectionItem.commandkey;" command="cmd_SwitchTextDirection" modifiers="accel,shift" /> - Add this line after the previous one :
<key id="key_Quit" key="&quitApplicationCmdWin.commandkey;" oncommand="goQuitApplication();" modifiers="accel"/> - Find the section that looks like
<menuitem id="menu_FileQuitItem" label="&quitApplicationCmdWin.label;" accesskey="&quitApplicationCmdWin.accesskey;" oncommand="goQuitApplication();"/> - Change that line to
<menuitem id="menu_FileQuitItem" label="&quitApplicationCmdWin.label;" accesskey="&quitApplicationCmdWin.accesskey;" oncommand="goQuitApplication();" key="key_Quit"/> - Save the file and exit the text editor
- Find
chrome\en-US\locale\browser\browser.dtdfile within the Firefox folder – This is another one of the file that was just unzipped - Find the section that looks like
<!ENTITY quitApplicationCmdWin.accesskey "x"> - Add this line right below that
<!ENTITY quitApplicationCmdWin.commandkey "q"> - Save the file and exit the text editor
- Close Firefox once, and re-run it
The newly created keyboard shortcut doesn’t show up in the menu unlike other shortcut with this method. I’m still looking for that tweak. But now I can quit the browser with ease when I need to.