Change Safari's search box to search Google UK

Mar 20, '09 07:30:00AM

Contributed by: Anonymous

Here's how to set Google UK as the search engine in Safari. You can use the following technique to change it to any location you prefer -- for example, France (.fr) -- but you must add (or remove) other characters to the string to keep it the same length. Please note you should not remove any of the URL, and you should also not remove or add %@ characters, as they are used as variables.

Here's what to do:

  1. Control-click on Safari in the Finder and select Show Package Contents from the pop-up menu.
  2. Navigate into the Contents » MacOS folder, and make a copy of the Safari file you find there. This is your backup in case anything goes wrong.
  3. Open the Safari file in MacOS with TextEdit. It will mainly look like a bunch of gibberish.
  4. Press Command-F to bring up the Find dialog, and then find this string: http://%@.google.com/%@?q=%@&ie=UTF-8&oe=UTF-8.
  5. Change that string to http://%@.google.co.uk/%@?q=%@&=UTF-8&oe=UTF-8. Note there are two changes here: .com to .co.uk (which adds two characters) and ie=UTF to =UTF (which removes two characters). The new string must be exactly the same length as the old or Safari will not work!
  6. Save your changes, close the file in TextEdit, and launch Safari.
I take no responsibility if you break anything, so make sure you back up the Safari file first!

[robg adds: Occasional hints editor Kirk McElhearn did some testing with the International System Preferences panel for me on this one -- Safari will use the local version of Google that matches the settings in the Language/Format tabs, as long as you also delete your Google cookies when making the changes. So this hint would mainly be useful to those who wish to have one location set via the International panel, but want to use a different local version of Google.

Please note that we covered something very similar nearly six years ago; this version is just focused on changing Google's default country, as opposed to changing the search engine entirely.

Update: More than likely, this hint will cause Safari's code signature to fail, resulting in Safari no longer being able to access the Keychain -- see this hint for more details on this problem (in 10.5 only).]

Comments (13)


Mac OS X Hints
http://hints.macworld.com/article.php?story=2009032004345842