Mar 05, '09 07:30:00AM • Contributed by: un0wn
The following is a guide, through the use of an external add-on, to add Safari's functionality within Firefox 3. Theoretically, these steps should be reproducible on Windows, Linux, and Mac systems. However, I have only tested it on my Mac, and the location of the .js file that needs to be edited will most likely vary.
Here's how I did this...
- Download and install Keyconfig.xpi. This plug-in is beyond awesome. It lets you change, modify, and add hot keys within Firefox. By default, the dialog with which to do so is hidden, so we'll have to bring that up to see all the hotkeys.
- Quit firefox. Create a new Firefox profile. Assuming you have Firefox installed in Applications, you'd do that with this command in Terminal: /Applications/Firefox.app/Contents/MacOS/firefox -ProfileManager. This step is crucial. I would never recommend working on your existing profile before trying out the edit on a clean profile. This is to make sure that you don't inadvertantly mess something up. Name it something that is different from your main profile, so it's easier to distinguish. (While you're in the Profile Manager, uncheck the Don't ask at startup box to make the Profile Manager appear when you launch Firefox.)
- Find the location of the prefs.js file for the profile you just created. On the Mac, it's located in your user's Libaray » Application Support » Firefox » Profiles » random_chars.newprofile folder. Normally this file should not be edited. Make sure that Firefox is closed while this file is being edited. Open the file in a text editor; BBedit is a good one on the Mac side.
- Paste the following line into the prefs.js file:
user_pref("keyconfig.main.xxx_key__Keyword 1", "!][][][if(window.loadURI) loadURI(getShortcutOrURI('BOOKMARKLET_KEYWORD',{}));");What this does is create a preference in Firefox's About:config page. keyconfig.main.xxx_key__Keyword 1: This bit creates the preference for the add-on Keyconfig, naming it Keyword 1. If you'd like it to be called something else, you can modify everything after key__.
The second part of this preference is the functional part that calls the bookmark for which you have set a keyword in your bookmarks: getShortcutOrURI('BOOKMARKLET_KEYWORD',{}));");. As you guessed, you edit the BOOKMARKLET_KEYWORD to whatever keyword you want. This is the same keyword that you will add to the actual bookmark in Firefox. - Save and close the prefs.js file, then launch Firefox and select the profile you made earlier.
- Select Bookmarks » Organize Bookmarks, and go to the Bookmarks Toolbar location, then click on More. In the Keyword box, add the keyword you added in the prefs.js file earlier to one of your bookmarks.
- Type Shift-Command-F12 to bring up the Keyconfig keybinding dialog. This is where you'll set the keybinding you wish to use. I recommend using the same as Safari, but you may want to choose your own. Safari uses Command-1, -2 etc. In Firefox, Command-1 is set to bring up tabs. So in order to use this, we'll need to disable the current bindings so they won't conflict.
- In the Keyconfig dialog, select the KeySelectTab_1 binding and click Disable. Repeat this for all the Tab preferences.
[robg adds: I haven't tested this one. I added the instructions for accessing the Profile Manager; if there's an easier way to get there, please note it in the comments.]
