philwilson.org

Use accesskeys for navigating Google search results pages with Greasemonkey

17 March, 2005

The Greasemonkey script: Enables navigation through Google search results pages using ALT+, and ALT+..

This script enables accesskeys for navigating through pages of Google search results using ALT+, for “previous page of results” and ALT+. for “next page of results”. I find it useful, so maybe someone else will too 🙂

I’ve been using Jesse Rudermans Search Keys Firefox extension since he first released it. It’s brilliant – when you perform a search on any of the listed search engines it inserts the numbers 1-0 after them, and makes them links, so that pressing “1” will take you to the first result, “2” the second, and so on. This has proved very useful for me, because I’m quite the keyboard fan, and tend to search Google from the address bar, and then just press the number of the result I want to see.

The problem was that if the result I wanted wasn’t on the first page then I had to grab my mouse and click “Next”, or use find-as-you-type and hope that the word “next”, or “xt” wasn’t in any of the links already there. This script helps me get around that, so that now I have a guaranteed method of moving between pages of the Google search results. Marvellous.

See other posts tagged with general and other posts made in March 2005.

Comments

Aaron
17 March, 2005 at 18:39

This is great, Phil.

Just wanted to let you know that the first sentence in your post has a typo – it says “Alt+. and Alt+.”. (neither of them is a comma).

But nice script. I’ll add it to the wiki if it isn’t already there.

Pip
18 March, 2005 at 10:46

Thanks for that Aaron, I would have fixed it sooner had Blogger actually been responding 🙂

Thanks also for adding it to the wiki already! Fast moving!

Michael
20 March, 2005 at 20:21

Great! Very cool.

clapu
25 March, 2005 at 13:21

http://www.google.fi has a slightly different web page:
<img src=/intl/fi/nav_current.gif …
http://www.google.se has /intl/sv/nav_current.gif…

With this fix it should work with local googles too:

“//img[contains(@src,’/nav_current.gif’)”

Very handy script, btw.

Pip
01 April, 2005 at 08:57

clapu, thanks for spotting that, I’d never have seen it myself! I’ll update the script. Thanks.

Anonymous
02 April, 2005 at 00:29

This is a great script. Works well with AccessBar (i.e. tells you what keys are defined). I have one suggestion:

In FF, you can turn off the default setting for the Location Bar to make it search google normally instead of the “I’m Feeling Lucky” search.

The default URL when you type something in is e.g. “keyword:soccer”

You should include an “@include keyword:*” bit in your code.

Cheers!

lepton
16 April, 2005 at 04:36

Nice work! I was looking all over for something like this.

Pip
16 April, 2005 at 17:57

Thanks!

bredend
13 May, 2005 at 13:25

Nice one, used an prev/next extension before but that one was buggy.
I changed the keys to left Alt+Z and left Alt+X because i still want find-as-you-type.

Let’s see if i can make some ‘macros’ for webbased applications at work.

Anonymous
29 May, 2005 at 16:39

Can anyone modify this to use Lexisnexis. i.e. go thru the pages like this google script. If you need some information, like to get into lexis, please email me at Jonathanquinn@gmail.com

Anonymous
26 September, 2005 at 20:47

I kept getting a javascript error:
Error: a has no properties
Source File: googleaccesskeys.user.js

I added the following code right after you set the variable ‘a’ and it seems to have fixed the problem:
if (!a) {
return;
}

Pip
27 September, 2005 at 09:17

Ah yes, hadn’t seen that. Should still work though.

Anonymous
08 August, 2006 at 19:34

hi
I’ve just recently discovered Greasemonkey, and this script would be very useful. Unfortunately, it does not work – I’ve tried it on Windows / Firefox 1.5 at work and on Linux / Firefox 1.5 at home, and nothing happens when I press alt+,/. . Am I missing something or has Google changed their html code? I analyzed html, and script seems to be doing the right think. Any ideas?
thx

Anonymous
22 October, 2006 at 18:56

Instead of ALT, how do I change it to use CTRL? The ALT key is hard to reach on my Powerbook keyboard.

Your IP address

Anonymous
27 October, 2006 at 19:38

This script does not work anymore, everybody who is looking for a working alternative should take a look at the “Add Prev/Next Accesskeys” on userscripts.org
Direct Link:
http://userscripts.org/scripts/show/3152