For quite some time, Google’s experimental search offered a “Keyboard shortcuts” experiment, where you could navigate search results with vi-style key bindings (j and k to navigate up and down search results, o or Enter to open a link, and / to move the cursor back to the search box).
It seems they have recently removed that experiment, as they sometimes do. I don’t know exactly when that happened, but The Wayback Machine puts it at somewhere between April 21 and now. But despite Google’s removing the experiment, the keyboard shortcuts had still been working just fine for me—until, that is, I revisited the page linked to in the first paragraph. Even just visiting that page, without taking any action, removed the shortcuts. The Accessible View experiment also provides similar keyboard shortcuts, but it does other things I don’t like, such as highlighting the currently selected search result blue.
PREF cookie, but the cookie’s content was highly opaque. There was a handy
_toggle() function which took the name of a feature to toggle. The two currently available experiments, Instant on Images and Accessible View, which pass in the names
_toggle(). Archive.org tells me that the keyboard shotcurts experiment used the name
So, the obvious next step was to see if running
_toggle('BetaShortcuts') on that page would fix up my cookie to give me back my keyboard shortcuts. I fired up the web console from Firefox’s Web Developer add-on and ran that command:
> _toggle('BetaShortcuts') TypeError: h("e_" + b) is null
D’oh. It’s trying to do something with the page’s DOM—ordinarily, when you click the “Join this experiment” button, it changes the button text to “Leave this experiment”, but there’s no button for the BetaShortcuts experiment to change the text for. The
h() function is just a thin wrapper around
document.getElementById(). Well, let’s try hacking around this by renaming one of the other buttons:
> h("e_Axs").id="e_BetaShortcuts" "e_BetaShortcuts" > _toggle('BetaShortcuts') undefined GET http://www.google.com/url?(various opaque parameters) [HTTP/1.1 204 No Content 88ms]
Close the page, and voila! Keyboard shortcuts work again.