Oh no, not another post about access keys? I'm afraid it is, but this is a nifty Greasemonkey script that not only exposes access keys used on the website you're visiting, but you can edit them to suit your preferences.
Author: Gez Lemon
Jacques Distler contacted me about a client-side solution for editable access keys he had written for his website, Musings. The footer contains a definition list of the access keys used throughout his website, and he uses scripting to allow them to be edited in place. Jacques suggested a Greasemonkey script that did the same thing for websites that use access keys. Unfortunately, it's the start of a new semester for Jacques, so he didn't have any spare time to implement the script. Fortunately for me, I've been wanting an excuse to play with Greasemonkey, so decided to write the script myself.
Installing the Manage Access Keys Script
If you don't already have Greasemonkey installed, you can download a version from the Greasemonkey website. The user script here requires version 0.6.4. Once you've installed the extension, you'll need to restart your browser (as you do with all Firefox extensions). After installing the extension, point your browser at http://juicystudio.com/services/mak.user.js, and you will be prompted to install the script by a monkey (providing you've installed 0.6.4 or higher).
Once you've installed the user script, a list of available access keys will be displayed at the foot of the page on websites that have implemented access keys, with an edit button to allow you to re-assign the access keys to your preference. For website owners that already display access keys on each page along with a facility to edit them, I have provided an
jsgmAccessKeyContainer so that the site can avoid running the user script. If the
id value is found anywhere in the content, the script does not provide the list of access keys. The
id value is deliberately obscure, so that a website is highly unlikely to incidentally use the
id value, but may be added anywhere in the content to prevent the script from running. Of course, if the script is annoying on certain websites or pages within a website, then there is a facility within the Greasemonkey extension to exclude those pages, or even remove the user script completely, or apply to specific sites or pages.
One of the suggestions Jacques made for the script was an option to revert back to the author's preferred keys. This should be a relatively straightforward task of just removing persistent data that was set with the
GM_setValue function; simple! Unfortunately, I couldn't figure out a way to do that. There doesn't appear to be anything within Greasemonkey itself to do that, but if you know different, then please let me know as I think it would be a very neat feature to have.
The script obviously doesn't play well with other scripts that do the same thing, particularly with the server-side user-defined access key class I wrote.
The reason is that the server-side solution relies entirely on cookies to define the access keys, but the Greasemonkey script is run afterwards, and re-assigns the keys to values set up using the script, and they take precedence. Because the server-side script doesn't have access to the data, it's blissfully unaware that the key bindings have been re-assigned, and displays the values that it's read from cookies.
- Added a button to restore author's suggested keys (2006-01-16)
- Added ability to toggle the display on and off using SHIFT + ESC, following a suggestion from Jacques Distler (2006-01-18)