Create a google search sheet in browsers

Sep 23, '02 08:26:05AM

Contributed by: Anonymous

I picked up this tip from Reinhold Penner in the Chimera mailing list. Basically you can get Chimera (and other browsers as well) to show a sheet with a text field to search in google. Very handy, and it's done by basically just adding a bit of JavaScript in the Apple InternetConfig setting file of OS X.

Just open ~/Library -> Preferences -> com.apple.internetconfig.plist in TextEdit (or Property List Editor if you have the developer tools) and look for the WebSearchPagePrefs entry. In TextEdit, this is what my entry looks like:

  <key>WebSearchPagePrefs</key>
<dict>
<key>ic-data</key>
<string>javascript:q=document.getSelection();
for(i=0;i<frames.length;i++){q=frames[i].document.getSelection();
if(q)break;}if(!q)void(q=prompt('Enter Google Search Keywords:',''));
if(q)location.href='http://www.google.com/search?client=googlet&q='+
escape(q)</string>
</dict>
In Property List Editor, just add the "javascript" bit, which should be one long line, not five as shown here for narrower display (no spaces, no carriage returns, just one long line). Save the changes and quit the editor. Now start Chimera and Select Search Page from the Go menu. Cool, eh?

Comments (14)


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