How do I assign a hotkey to a Firefox bookmark?
August 23, 2005 7:20 PM   Subscribe

I have a bookmarklet that I'd like to run by a pressing a hotkey in Firefox -- any suggestions? I've set up a mouse gesture to do this, but I'd like a keyboard shortcut as well.
posted by arathorn to Technology (4 answers total) 1 user marked this as a favorite
 
There's an extention for that:
http://extensionroom.mozdev.org/more-info/keyconfig
posted by tresbizzare at 8:03 PM on August 23, 2005


Response by poster: Yeah, I found the keyconfig extension -- looks like it'll let me assign a hotkey to a user-defined Javascript command. How do I access/open Firefox bookmarks from Javascript? (Yeah, I probably could just directly assign the hotkey to the javascript content of the bookmarklet, but I have some bookmark management functionality that I would lose by doing this.) Thanks
posted by arathorn at 8:43 PM on August 23, 2005


Best answer: Try this.

Install keyconfig.

Assign a keyword in the bookmark's properties.

Open the Firefox configuration file prefs.js (C:\Documents and Settings\%USERNAME%\Application Data\Mozilla\Firefox\Profiles\profile_name\prefs.js in Windows XP)

On a new line add the following:
user_pref("keyconfig.main.xxx_key__Keyword 1", "!][][][if(window.loadURI) loadURI(getShortcutOrURI('BOOKMARKLET_KEYWORD',{}));");

Replace "BOOKMARKLET_KEYWORD" with the keyword you choose.

Restart Firefox and assign shortcut keys for Keyword 1 in the Keyconfig window. (Tools->Keyconfig)

Let me know how it works out.
posted by tresbizzare at 9:53 PM on August 23, 2005


That should be a single line added to prefs.js.

user_pref("keyconfig.main.xxx_key__Keyword 1", "!][][][if(window.loadURI) loadURI(getShortcutOrURI('BOOKMARKLET_KEYWORD',{}));");

If you copy and paste it directly it should work fine.
posted by tresbizzare at 10:00 PM on August 23, 2005


« Older Family Photo Project   |   What's good to make with canned tuna fish? Newer »
This thread is closed to new comments.