Creating Hotkeys in Firefox for bookmarks (bookmarklets)

I would like to set up shortcuts (hotkeys) for several Firefox bookmarks (they're actually bookmarklets). One example is the pinboard.in bookmarklet. Does anyone know how to do this?


Solution 1:

Initially, my solution was to assign a keyword to a bookmarklet and then use AutoHotkey to automate the following steps: pressing Ctrl+L to select the address bar, typing in the keyword, and pressing Enter.

This works great with normal bookmarks, as you will be taken to a new page. However, with bookmarklets that work with the current page, this is clumsy and moves the keyboard's focus. So, in an effort to avoid the address bar altogether, I've devised the following solution.

Setup:

  1. Create a new folder in the Bookmarks Menu. Since we will be using the keyboard, give it a name that can be accessed with one keystroke, i.e. the first character is unique. I chose .Hotkeyed.

  2. Move your bookmark to this folder, renaming them to begin with a character. This character will be used as part of the hotkey. For example, a : Bookmark.

  3. Now, let's be sure we can click the bookmark using the keyboard. Pressing Alt, B, . should nagivate like so:

    bookmark menu

    and pressing a should click the first bookmark.

AutoHotkey Script:

Why press four keys, when you do it in less?

#a:: ;Win+A
KeyWait, LWin ; Win+Alt alone does nothing.
Send, {Alt} ;Menu >
Send, b ;Bookmarks >
Send, . ;.Hotkeyed >
Send, a ;Bookmark 1
Exit

Solution 2:

Although this is not quite what you are asking, it might be of interest. I do the following:

  • right click on the bookmark you want
  • select copy from the menu
  • go to the desktop
  • right click on the desktop and click paste shortcut
  • right click on the shortcut once it is in place, select the Web Document tab and enter the short cut you want in the Shortcut Key field.
  • click OK - you are done (if you like you can change the name of the shortcut on the desktop to include the description of the short cut, e.g. "CTRL+ SHIFT + G - Google")

Advantages: works with no installation of add-on; allows you to summon up the link even if you are not in firefox; you can use any shortcut that does not clash with something else, and are not restricted to CTRL 1-9 or something

Disadvantage: you end up with a bunch of shortcuts sitting on your desktop; if you delete the shortcut you have lost the "keybinding"

Hope this helps

Solution 3:

Once a keyword is assigned to the bookmarklet the standard way works, ie. typing the keyword and pressing Enter. What may be misleading is that FireFox doesn't display the bookmarklet in the location bar popup. But it works. Tested on FF 39.

Say you want to use SuperGenPass bookmarklet. Assign it a keyword, say sgp and it may be launched from location bar by typing sgp and pressing Enter.

Solution 4:

You can have actual keyboard shortcuts for bookmarklets in Firefox. All you need is Keyconfig - an add-on which allows you to rebind Firefox keyboard shortcuts.

Follow these steps:

  1. Install Keyconfig
  2. Edit your bookmark and add a unique keyword in the keyword field
  3. Open Keyconfig (Ctrl+Shift+F12)
  4. Click Add a new key
  5. Paste following code into the text area below the name: getShortcutOrURIAndPostData('KEYWORD').then(function(result){loadURI(result.url);});
    replacing KEYWORD with the keyword you added to your bookmark, then click OK
  6. Select that small text field under the list and press a key combination that you'd like to bind to your bookmark
    • If a message pops up saying that this combination is already used - you can find and disable the action that is already bound to it, or choose another combination
  7. Click Apply and you're done. You can add another shortcut or close Keyconfig window