Skip to content

Instantly share code, notes, and snippets.

@fancyremarker
Created September 29, 2011 22:26
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save fancyremarker/1252109 to your computer and use it in GitHub Desktop.
Save fancyremarker/1252109 to your computer and use it in GitHub Desktop.
Re-enable Google Keyboard Shortcuts in Chrome on OS X, by editing cookie database directly
#!/bin/sh
# Force Google Keyboard Shortcuts experimental search in Chrome
COOKIEJAR=~/Library/Application\ Support/Google/Chrome/Default/Cookies
OLDCOOKIEVAL=$(sqlite3 "$COOKIEJAR" "select value from cookies where host_key = '.google.com' and name = 'PREF';")
NEWCOOKIEVAL=$(echo $OLDCOOKIEVAL | sed 's/:GM=[^:]*:/:/' | sed 's/:ES=[^:]*:/:/' | sed 's/:S=/:GM=1:ES=WBS:S=/')
sqlite3 "$COOKIEJAR" "update cookies set value = '$NEWCOOKIEVAL' where host_key = '.google.com' and name = 'PREF';"
@fancyremarker
Copy link
Author

For anyone who installed the Google Keyboard Shortcuts "Search Experiment" (formerly listed here, but evidently no longer supported), cleared their cookies, and wants their Keyboard Shortcuts back, run the above script.

It should also work for other browser/OS combinations that use SQLite for the cookie database (e.g., Firefox). Just change the value of the COOKIEJAR variable.

@fancyremarker
Copy link
Author

Uh, another note... apparently if you visit the Experimental Search page (linked in the previous comment), your cookies will be reset to opt you out of the Keyboard Shortcuts experiment again. So don't click the link...

@fancyremarker
Copy link
Author

This doesn't work anymore. Google has officially killed the Keyboard Shortcuts experiment. :-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment