8

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?

2
  • ask.metafilter.com/23032/…
    – Tommy
    Feb 9, 2012 at 2:12
  • The keyconfig extension described in the referenced article partially works. The instructions are wrong (or perhaps difficult to follow). When properly configured, a shortcut key will work, except NoScript seems to block it (unless the page is unblocked). Clicking on the bookmarklet does not seem to be affected by NoScript, and I'd like the same to apply for the shortcut.
    – jdigital
    Feb 9, 2012 at 4:57

6 Answers 6

9

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
13
  • Thanks for your reply. This works but it changes the contents of the address bar. Can you find a way to restore the address bar to its original contents?
    – jdigital
    Feb 9, 2012 at 19:04
  • @jdigital Sure! I will update the script.
    – iglvzx
    Feb 9, 2012 at 19:06
  • Hold on... I have a better idea which avoids the address bar altogether.
    – iglvzx
    Feb 9, 2012 at 19:23
  • 1
    Great idea: placing the bookmarklet in a menu location that is accessible by single letter navigation. The IfWinActive code doesn't work for me, but you've provided enough information here to allow me to solve the problem. Thank you!
    – jdigital
    Feb 9, 2012 at 20:53
  • 1
    @jdigital Ah. I sometimes have problems with #IfWinActive, too. I'll remove it, since it is not strictly necessary. You're welcome!
    – iglvzx
    Feb 9, 2012 at 21:03
2

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.

1
  • This still works in 2023. Assign the keyword by r-clicking on the bookmarklet and selecting Edit Bookmark. To use the keyword while browsing use Alt-D to activate the location bar and then type your keyword. So in this case : Alt-D sgp Apr 21 at 22:47
2

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
3
  • Thanks a lot, MacGyver! Combined with my answer here, this brings back the functionality of the disappeared "Open Chromeless" extension. And I even already had the Keyconfig addon installed, but in an older version – so second thanks for pointing out the updated version: +1 for your answer :)
    – Izzy
    Nov 22, 2016 at 15:18
  • 2
    KeyConfig no longer exists for more recent versions of Firefox. A lot of its functionality was taken over by the Firefox built-in Manage Extension Shortcuts (from the gear-menu of about:addons) but that is limited to addon shortcuts as the name implies. Dec 5, 2020 at 20:42
  • This is sooooooooo irritating. Every so often a solution for doing what I want to do (use a KEYBOARD SHORTCUT to go to a particular URL) comes along and disappears after a couple of years (or less). "Manage Extension Shortcuts" does absolutely NOT do what is being asked for. Dec 25, 2022 at 12:27
1

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

0

Try AutoHotkey (not only for Firefox but for any application...)

2
  • We need to know an operating system first. AHK is for Windows.
    – iglvzx
    Feb 9, 2012 at 4:30
  • 1
    I'm running Windows. I've written AHK scripts, but can't figure out how to write a script to activate a Bookmarklet.
    – jdigital
    Feb 9, 2012 at 4:40
0

There is a Shortkeys (Custom Keyboard Shortcuts) addon for Firefox.

Access Bookmark Toolbar items with a keyboard shortcut. The default is Control+1-9. Change it in the preferences.

4
  • This extension works for bookmarks, but doesn't seem to work for bookmarklets.
    – khamer
    Apr 27, 2016 at 13:57
  • I'm using this extension just for bookmarklets. But I noticed it will only work if the bookmark toolbar is visible.
    – zany
    Apr 27, 2016 at 14:43
  • It is not working for bookmarklets in Firefox 97. Jan 29, 2022 at 16:57
  • I've updated the link, the old link didn't work anymore. Tested in 97.0b9 with a JS snippet.
    – zany
    Jan 30, 2022 at 17:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .