Making Chromium use my local Google

When I came back from my trip to Australia, I noticed all my Google searches from Chromium were searching Google Australia (google.com.au). This sucked, because I wanted to use google.co.uk again to get local results.

There’s many articles on the internet about changing the Google “base URL” in Chromium. After reading some, I visited www.google.com/ncr (“no-country-redirect”) to get Chromium to read the new base URL. This worked, but then I was stuck searching google.com.

Finally, I gave up Googling and decided to hack it myself.

Manipulating cookies

From what I read, the base URL for Google can be fixed by clearing all your cookies and then visiting your local Google. However, I didn’t want to clear all cookies for all my sites - only the ones for Google.

Chromium doesn’t have a cookie manager built in, but thankfully the developers had the wise idea of using sqlite as the cookie storage backend. This means it is relatively easy to manipulate the cookies you want using sqlite.

Opening Chromium cookie database with sqlite

Firstly, I quit Chromium. Next:

dsimmons:~ dan$ cd Library/Application\ Support/Chromium/Default/
dsimmons:Default dan$ sqlite3 Cookies
SQLite version 3.6.12
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> delete from cookies where host_key like '.google.co.uk';
sqlite> delete from cookies where host_key like '.google.com';
sqlite> exit
dsimmons:Default dan$ 

All done! My Google cookies are gone.

Upon restarting Chromium, I went to “www.google.co.uk”, restarted Chromium again, and voila! Searches from Chromium now use my local Google.

It is also good to know that cookies in Chromium can be easily manipulated using basic SQL:

sqlite> .headers on
sqlite> .tables
cookies  meta   
sqlite> select * from cookies limit 5;
etc. 

Have some fun!