This hint describes a way of changing Safari's default search engine. Unlike the method which was posted a couple of days ago, this method does not block normal access to google.com. This hint assumes you are familiar with the vi text editor. First, quit Safari and make a backup copy of the application. Then follow these steps:
% vi /Applications/Safari.app/Contents/MacOS/Safari
http://%@.google.com/%@?q=%@&ie=UTF-8&oe=UTF-8This is the string that needs to be modified.
http://%@.google.com/%@?q=%@&ie=UTF-8&oe=UTF-8with:
http://%@@search.yahoo.com/bin/search?p=%@&a=0The way I figured this out was by performing a search at yahoo.com for "apple". The URL of the results page was:
http://search.yahoo.com/bin/search?p=appleSo to keep my length constant, I needed to expand the string a little. I added a %@@ at the beginning of the URL. Putting "something@" at the beginning of a URL will not affect the loading of a site. This allowed me to take care of the first %@ sequence I needed to retain. Then I replaced apple with another %@. This is obviously where my 'query' fits into the URL. Finally, I needed to add a bogus (unused) form field to the URL, so that the string would be the correct length. I added &a=0. So if you take a look at the original string, and the new one, the lengths of both strings are identical, as seen above.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20030514035516436