Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Add Mozilla-like keyword functionality to Safari's search bar Apps
To add Mozilla-like keyword functionality to Safari's search bar, point Safari's search engine to a local script, which looks for your personal keywords and redirects the HTTP request accordingly. This will let you type img madonna into Safari's search bar to search images.google.com for pictures of Madonna, for example.

To point Safari's search engine to the local script, replace http://%@.google.com/%@?q=%@&ie=UTF-8&oe=UTF-8 with http://%@@localhost/%@.php?q=%@&thisarg=adummy in Safari.app (control-click) -> Contents -> MacOS -> Safari (see nimatoad's original hint on how to do that).

Read the rest of the hint for the how-to details...

The rest can be done via the following script, which should be named search.php, and saved to your webserver's document root (usually /Library -> Webserver -> Documents). Of course, you must have Personal Web Sharing and PHP enabled for this to work.

<?
/*
Add Mozilla-like keyword functionality to Safari's search bar.

Author: sapporo@land.ru (inspired by a hint from nimatoad at
http://www.macosxhints.com/article.php?story=20030514035516436)

TO DO: german umlauts don't show up the way they should at the
target site

There's another method of redirecting Safari searches by editing
/etc -> hosts (as proposed here:
http://www.macosxhints.com/article.php?story=20030509004243460),
but this seemed to be the easiest one. You'll have to modifiy
Safari.app after you update it (and pray they didn't change the
way searching works).

*/

// add your own keywords here
$keywords = array(
    "y"    => "http://search.yahoo.com/bin/search?p=%query%",
    "atw"  => "http://www.alltheweb.com/search?q=%query%",
    "t"    => "http://s.teoma.com/search?q=%query%",
    "img"  => "http://images.google.com/images?q=%query%&ie=ISO-8859-1&hl=en&btnG=Google+Search",
    "php"  => "http://www.php.net/%query%"
    );

// the original search term
$q = urldecode($_GET['q']);

// show help screen
if (preg_match("/^\s*help/i", $q)) {
    echo "<html><body><center><h2>Search help:</h2><table>";
    while (list ($key, $location) = each ($keywords)) {
           echo "<tr><td>$key </td><td>$location</td></tr>\n";
      }
    echo "</table><p><a href='mailto:sapporo@land.ru'>sapporo@land.ru</a></body></html>";
    exit;
}

// search for matching keyword and redirect on success
while (list ($key, $location) = each ($keywords)) {
   if (preg_match("/^\s*$key\s+(.*)/i", $q, $matches)) {
       $val = str_replace("%query%", urlencode($matches[1]), $location);
         header("Location: $val");
         exit;
     }
}

// default to google.com
header("Location: http://www.google.com/search?q=".$_GET['q']."&ie=UTF-8&oe=UTF-8");

?>
[robg adds: I haven't tested this script myself.]
    •    
  • Currently 2.75 / 5
  You rated: 5 / 5 (12 votes cast)
 
[83,479 views]  

Add Mozilla-like keyword functionality to Safari's search bar | 29 comments | Create New Account
Click here to return to the 'Add Mozilla-like keyword functionality to Safari's search bar' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Opera, too
Authored by: jspivack on May 20, '03 10:20:22AM

This was a good feature of Opera too...thanks for figuring this one out!

here's another good search string:
Froogle: "http://froogle.google.com/froogle?q%query%"

I tried eBay, but it seems a lot more complex...



[ Reply to This | # ]
oops
Authored by: jspivack on May 20, '03 10:44:26AM

i forgot an "="...that search string should read

"http://froogle.google.com/froogle?q=%query%"



[ Reply to This | # ]
Not SnapBack compatible...
Authored by: jspivack on May 20, '03 10:49:33AM

This doesn't seem to trigger SnapBack recognition--if you open a new tab and do a non-google search, the orange "SnapBack" button doesn't appear. I wonder if there's a way to improve this script to make it trigger the "Mark page for SnapBack" menu item...probably not in PHP, eh?



[ Reply to This | # ]
Not SnapBack compatible...
Authored by: seven5 on May 20, '03 08:51:11PM

once you click on the link after the search the snap back will work, it did for me...



[ Reply to This | # ]
Add Mozilla-like keyword functionality to Safari's search bar
Authored by: seven5 on May 20, '03 06:22:33PM

you my friend are a genius. a GENIUS!!!!!!

I have been wanting a PRO feature like this for a while, i wanted a way for my search bar to read my mind. I did not want to pick from a drop down for a specific search, i wanted it to just KNOW what i was searching for and where to search for it.

I sent in the idea of having search parameters, so if you searched for: web browser you would do this:

web browser -i : image search
web browser -v : Versiontracker search
web browser -m : imdb search
web browser : Google search

notice the last one has no parameter, so the default would be just google, or whatever you wanted. Now i can do this!!!!!!!

Great thinking, very innovative mind you have there. I dont know why i didn't think about this when i read the hint about directing the search bar to another search engine.

I'm gonna work on a script that will parse the parameters how i suggested, when i have something stable i'll post it here, thanks!!!!!



[ Reply to This | # ]
Add Mozilla-like keyword functionality to Safari's search bar
Authored by: ed209 on May 20, '03 09:02:25PM

Let's not reinvent the wheel - how cool if somebody decides to port Dave's Quick Search Taskbar for Safari.

<http://www.dqsd.net/>

Sure it's for windows originally, but it is truly awesome.
Check it out.



[ Reply to This | # ]
The Greatest!
Authored by: max_ on May 20, '03 09:13:00PM

This is the only feature not in Safari that i need, and now i have it. :)) i am very happy.

"vt" => "http://versiontracker.com/mp/new_search.m?productDB=mac&mode=Quick&OS_Filter=MacOSX&search=%query%&x=0&y=0",
"hint" => "http://www.macosxhints.com/search.php?query=%query%&type=stories&mode=search&keyType=all",
"au" => "http://www.google.com.au/search?q=%query%&ie=ISO-8859-1&hl=en&btnG=Google+Search&meta=cr%3DcountryAU"

And here's a couple more lines if you want to add google australia search, version tracker, and yes - macosxhints :)



[ Reply to This | # ]
Room for improvement
Authored by: sapporo on May 21, '03 05:24:56AM

Thanks all.

The one thing I'd still like to fix is that umlauts and quotes don't show up at the target site the way they should. The problem lies with PHP's urlencode() method, which does a little more encoding than what's needed here.

Unfortunately, I don't currently have the time to play around with this.. maybe someone else would like to fix this?

Cheers,
-sapporo.



[ Reply to This | # ]
An alternative approach
Authored by: pbx on May 21, '03 06:53:21PM
Very clever hack!

I put together something similar with a slightly fussier query syntax, but which works systemwide. It does require you to be comfortable with configuring Apache and Netinfo, but doesn't involve editing binaries, Safari or otherwise.

I wrote it up here.

[ Reply to This | # ]
It's umlaut-safe now.
Authored by: Baumi on May 21, '03 09:47:35PM
Here's what to do to make the script work with umlauts:

Blelow the line

$q = urldecode($_GET['q']);

add this line:

$q = utf8_decode($q);

and replace the line

header("Location: http://www.google.com/search?q=".$_GET['q']."&ie=UTF-8&oe=UTF-8");

with

header("Location: http://www.google.com/search?q=".urlencode($q)."&ie=ISO-8859-1");

That's all, folks. :-)

Baumi

[ Reply to This | # ]
Really umlaut-safe now;)
Authored by: kmue on May 23, '03 05:02:06AM

Some search engines are accepting UTF encoded chars but others are expecting ISO encoded chars.
So give them what they want...

Here is my version. All searches are working with I18 chars:

<?
/*
Add Mozilla-like keyword functionality to Safari's search bar.
http://www.macosxhints.com/article.php?story=20030519070642235

Author: sapporo@land.ru (inspired by a hint from nimatoad at
http://www.macosxhints.com/article.php?story=20030514035516436)

Umlaut hint by Baumi. Changes by kmue to make it work with I18 chars.
*/

// add your own keywords here
$keywords = array(
"vt" => "http://versiontracker.com/mp/new_search.m?productDB=mac&mode=Quick&OS_Filter=MacOSX&search=%query%&x=0&y=0",
"hints" => "http://www.macosxhints.com/search.php?query=%isoquery%&type=stories&mode=search&keyType=all",
"atw" => "http://www.alltheweb.com/search?q=%isoquery%&cs=iso-8859-1",
"t" => "http://s.teoma.com/search?q=%isoquery%",
"img" => "http://images.google.com/images?q=%query%&ie=UTF-8&oe=UTF-8"
);

// the original search term
$q = urldecode($_GET['q']);

// show help screen
if (preg_match("/^\s*(help|\?)/i", $q)) {
echo "<html><body><center><h2>Search help:</h2><table>";
echo "<tr><td><b>key</b></td><td><b>location</b></td></tr>\n";
while (list ($key, $location) = each ($keywords)) {
echo "<tr><td>$key:</td><td>$location</td></tr>\n";
}
echo "</table></body></html>";
exit;
}

// search for matching keyword and redirect on success
while (list ($key, $location) = each ($keywords)) {
if (preg_match("/^\s*$key\s+(.*)/i", $q, $matches)) {
if (preg_match("/%isoquery%/", $location)) {
$val = str_replace("%isoquery%", urlencode(utf8_decode($matches[1])), $location);
} else {
$val = str_replace("%query%", urlencode($matches[1]), $location);
}
header("Location: $val");
exit;
}
}

// default to google.com
header("Location: http://www.google.com/search?q=".urlencode($_GET['q'])."&ie=UTF-8&oe=UTF-8");
?>



[ Reply to This | # ]
Really umlaut-safe now;)
Authored by: tnagpal on May 23, '03 04:16:35PM

I'm really having problems with this script, when I try a search I get a 500 Internal Server Error.

If I type in tail /var/log/httpd/error_log, I get the following:

[Fri May 23 15:08:46 2003] [error] (8)Exec format error: exec of /Library/WebServer/CGI-Executables/search.php failed

[Fri May 23 15:08:46 2003] [error] [client 127.0.0.1] Premature end of script headers: /Library/WebServer/CGI-Executables/search.php

I chmodded the file to 755 and still get this error, anyone able to help?



[ Reply to This | # ]
Doesn't work with "quotes"
Authored by: jason mark on May 25, '03 10:28:52AM

I constantly use select quotes in searches. For example I might search for:
y "select quotes" google search

But this PHP script converts quotes to \" for some reason. So the above search would turn into:
\"select quotes\" google search

Any advice on how to fix this? I'm guessing its similar to the umlat question that germans are having...



[ Reply to This | # ]
Doesn't work with "quotes"
Authored by: pbx on May 27, '03 04:58:10PM
Change this: $q = urldecode($_GET['q']); to this: $q = urldecode(stripslashes($_GET['q'])); This assumes that magic_quotes_gpc is ON (that's what is escaping the quotes in the first place), but shouldn't have any negative effect if it's off.

I made this fix in my lazysearch script as well.

[ Reply to This | # ]
Thanks!
Authored by: jason mark on May 28, '03 04:39:42PM

You rock man....



[ Reply to This | # ]
Doesn't work with "quotes"
Authored by: discordantus on May 29, '03 06:41:38PM
actually, it will cause problems if magic quoting is off... it will eat any backslashes. The following code checks first to see if they are on or not:

if (get_magic_quotes_gpc()) {
	$q = utf8_decode(stripslashes($_GET['q']));
else
	$q = utf8_decode($_GET['q']);
if you ever distribute the script, it should check for magic quoting something like that.

[ Reply to This | # ]
Yes
Authored by: pbx on May 30, '03 10:00:06AM

You're correct -- when I said it was unlikely to cause problems I was referring to the fact that the backslash is not a meaningful character for most search engines. But your way (with proper bracketing of course) is safest.



[ Reply to This | # ]
doesnt seem to work with entropy's 4.3.3 php binaries
Authored by: 1equals0 on Sep 01, '03 11:57:51PM

I can't get it to work.
Does it work with PHP 4.3.3 from entropy.ch binary?

I get this in /var/log/httpd/error.log :

[Mon Sep 1 23:48:15 2003] [error] PHP Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /Library/WebServer/Documents/search.php on line 22

[Mon Sep 1 23:48:15 2003] [error] PHP Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /Library/WebServer/Documents/search.php on line 30



[ Reply to This | # ]
reverted to 4.3.2. still no go
Authored by: 1equals0 on Sep 02, '03 12:17:31AM

same error.
this is on 10.2.6.
dont understand the error

[Tue Sep 2 00:15:32 2003] [error] PHP Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /Library/WebServer/Documents/search.php on line 22

[Tue Sep 2 00:15:32 2003] [error] PHP Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /Library/WebServer/Documents/search.php on line 30



[ Reply to This | # ]
Add Mozilla-like keyword functionality to Safari's search bar
Authored by: tokek on May 18, '05 06:01:30AM
Thanks for the tip. It's really brilliant since the hack still works for Safari 1.3. I've made my own changes (my first try at PHP):
  • parameter-less keywords (eg. "bbc" goes to BBC News)
  • Parse strings into any specified character encoding (cf. EUC-JP example)
    *Mozilla's can't do this.
  • more use of array lookups, fewer while loops, preg matching
  • uses stripslashes to undo automatic addslashes.

<?
/*
Add Mozilla-like keyword functionality to Safari's search bar.

Author: sapporo@land.ru (inspired by a hint from nimatoad at
http://www.macosxhints.com/article.php?story=20030514035516436)

TO DO: german umlauts don't show up the way they should at the
target site

There's another method of redirecting Safari searches by editing
/etc -> hosts (as proposed here:
http://www.macosxhints.com/article.php?story=20030509004243460),
but this seemed to be the easiest one. You'll have to modifiy
Safari.app after you update it (and pray they didn't change the
way searching works).

*/
/*
Originally from:
	http://www.macosxhints.com/article.php?story=20030519070642235

Some of the changes made:
	+ parameter-less keywords (eg. "bbc" goes to BBC News)
	+ Parse strings into any specified character encoding (cf. EUC-JP example)
	+ more use of array lookups, fewer while loops, preg matching
	+ uses stripslashes to undo automatic addslashes.
-- 20050518 Tokek
*/

// add your own keywords here
$keywords = array(
	"az"   => "http://www.amazon.com/exec/obidos/external-search?mode=blended&keyword=%query%",
	"azj"  => "http://www.amazon.co.jp/exec/obidos/external-search?mode=blended&keyword=%query%",
	"c"    => "http://www.%query%.com/",
	"d"    => "http://dictionary.reference.com/search?q=%query%",
	"en"   => "http://www.google.com/search?ie=UTF-8&oe=UTF-8&lr=lang_en&q=%query%",
	"f"    => "http://froogle.google.com/froogle?q=%query%",
	"g"    => "http://www.google.com/search?ie=UTF-8&oe=UTF-8&q=%query%",
	"gi"   => "http://images.google.com/images?ie=UTF-8&oe=UTF-8&safe=off&q=%query%",
	"gj"   => "http://www.google.com/search?ie=UTF-8&oe=UTF-8&lr=lang_ja&hl=ja&q=%query%",
	"gij"  => "http://images.google.com/images?ie=UTF-8&oe=UTF-8&safe=off&lr=lang_ja&hl=ja&q=%query%",
	"gji"  => "http://images.google.com/images?ie=UTF-8&oe=UTF-8&safe=off&lr=lang_ja&hl=ja&q=%query%",
	"m"    => "http://www.google.com/search?ie=UTF-8&oe=UTF-8&q=%query%+site:macosxhints.com",
	"q"    => "http://www.google.com/search?ie=UTF-8&oe=UTF-8&q=%22%query%%22",
	"w"    => "http://en.wikipedia.org/w/wiki.phtml?search=%query%&go=Go",
	"wj"   => "http://ja.wikipedia.org/wiki/%query%",
);

// shortword - self-made neologism meaning parameter-less custom keyword
$shortwords = array(
	"g"    => "http://www.google.com/",
	"ym"   => "http://mail.yahoo.com/",
	"gm"   => "http://gmail.google.com/gmail",
	"goo"   => "http://dictionary.goo.ne.jp/",
	"bbc"   => "http://news.bbc.co.uk/",
);


// the original search term
// remove slashes that were automatically added
$q = urldecode(stripslashes($_GET['q']));

// show help screen
if ("help" == $q) {
	echo "<html><body><center><h2>Search help:</h2><table>";
	while (list ($key, $location) = each ($keywords)) {
		echo "<tr><td>$key </td><td>$location</td></tr>\n";
	}
	echo "</table><p>Cmd+Option+F for the searchbox.";
	echo "<p>http://www.macosxhints.com/article.php?story=20030519070642235";
	echo "<p><a href='mailto:sapporo@land.ru'>sapporo@land.ru</a></body></html>";
	exit;
}

// E3 80 80 is ideographic space character (U+3000) in UTF-8 byte sequence
if (preg_match("/^([a-z]+)(\xE3\x80\x80|\s)(.*)/", $q, $matches)) {
	$key = $matches[1];
	$query = $matches[3];
	$location = $keywords[$key];
	if ($location != "") {
		$val = str_replace("%query%", urlencode($query), $location);
		header("Location: $val");
		exit;
	}
	if ($key == "goo") {
		$val = str_replace(
			"%query%", 
			//  url encode EUC-JP byte sequence obtained from reading UTF-8 byte sequence.
			urlencode(mb_convert_encoding($query, "EUC-JP", "UTF-8")),
			"http://dictionary.goo.ne.jp/search.php?MT=%query%&kind=&mode=0"
		);
		header("Location: $val");
		exit;
	}
}
else {
	// search for matching shortword and redirect upon success
	$location = $shortwords[$q];
	if ($location != "") {
		header("Location: $location");
		exit;
	}
}

// default to google.com
header("Location: http://www.google.com/search?&ie=UTF-8&oe=UTF-8&q=".urlencode($q));

?>


[ Reply to This | # ]
Update
Authored by: tokek on May 20, '05 06:32:12PM
Updated version:

<?
/*
Add Mozilla-like keyword functionality to Safari's search bar.

Author: sapporo@land.ru (inspired by a hint from nimatoad at
http://www.macosxhints.com/article.php?story=20030514035516436)

TO DO: german umlauts don't show up the way they should at the
target site

There's another method of redirecting Safari searches by editing
/etc -> hosts (as proposed here:
http://www.macosxhints.com/article.php?story=20030509004243460),
but this seemed to be the easiest one. You'll have to modifiy
Safari.app after you update it (and pray they didn't change the
way searching works).

*/
/*
Originally from:
	http://www.macosxhints.com/article.php?story=20030519070642235

Some of the changes made:
	+ parameter-less keywords (eg. "bbc" goes to BBC News)
	+ Parse strings into any specified character encoding (UTF-8 when unspecified)
	+ more use of array lookups, fewer while loops, preg matching
	+ uses stripslashes to undo the effects of automatic addslashes.
-- 20050520 Tokek
*/


// add your own keywords here

$keywords = array(
	"az"   => array("http://www.amazon.com/exec/obidos/external-search?mode=blended&keyword=%query%"),
	"azj"  => array("http://www.amazon.co.jp/exec/obidos/external-search?mode=blended&keyword=%query%"),
	"c"    => array("http://www.%query%.com/"),
	"en"   => array("http://www.google.com/search?ie=UTF-8&oe=UTF-8&lr=lang_en&q=%query%"),
	"f"    => array("http://froogle.google.com/froogle?q=%query%"),
	"g"    => array("http://www.google.com/search?ie=UTF-8&oe=UTF-8&q=%query%"),
	"gi"   => array("http://images.google.com/images?ie=UTF-8&oe=UTF-8&safe=off&q=%query%"),
	"gj"   => array("http://www.google.com/search?ie=UTF-8&oe=UTF-8&lr=lang_ja&hl=ja&q=%query%"),
	"gij"  => array("http://images.google.com/images?ie=UTF-8&oe=UTF-8&safe=off&lr=lang_ja&hl=ja&q=%query%"),
	"gji"  => array("http://images.google.com/images?ie=UTF-8&oe=UTF-8&safe=off&lr=lang_ja&hl=ja&q=%query%"),
	"m"    => array("http://www.google.com/search?ie=UTF-8&oe=UTF-8&q=%query%+site:macosxhints.com"),
	"q"    => array("http://www.google.com/search?ie=UTF-8&oe=UTF-8&q=%22%query%%22"),
	"wj"   => array("http://ja.wikipedia.org/wiki/%query%"),
	"d"    => array("http://dictionary.reference.com/search?q=%query%", "ISO-8859-1"),
	"w"    => array("http://en.wikipedia.org/w/wiki.phtml?search=%query%&go=Go", "ISO-8859-1"),
	"goo"  => array("http://dictionary.goo.ne.jp/search.php?MT=%query%&kind=jn&mode=0", "EUC-JP"),
);



// shortword - self-made neologism meaning parameter-less custom keyword
$shortwords = array(
	"g"    => "http://www.google.com/",
	"ym"   => "http://mail.yahoo.com/",
	"gm"   => "http://gmail.google.com/gmail",
	"goo"   => "http://dictionary.goo.ne.jp/",
	"bbc"   => "http://news.bbc.co.uk/",
);


// the original search term
// remove slashes that were automatically added
$q = urldecode(stripslashes($_GET['q']));

// show help screen
if ("help" == $q) {

	echo "<html><body><center><h2>Search help:</h2><table>";
	while (list ($key, $location) = each ($keywords)) {
		echo "<tr><td>$key </td><td>$location</td></tr>\n";
	}
	echo "</table><p>Cmd+Option+F for the searchbox.";
	echo "<p>http://www.macosxhints.com/article.php?story=20030519070642235";
	echo "<p><a href='mailto:sapporo@land.ru'>sapporo@land.ru</a></body></html>";
	exit;
}

// E3 80 80 is ideographic space character (U+3000) in UTF-8 byte sequence
if (preg_match("/^([a-z]+)(\xE3\x80\x80|\s)(.*)/", $q, $matches)) {
	$key = $matches[1];
	$query = $matches[3];
	list($location, $charset) = $keywords[$key];
	if ($location != "") {
		if ($charset != "") {
			$query = mb_convert_encoding($query, $charset, "UTF-8");
		}
		header("Location: $val".str_replace("%query%", urlencode($query), $location));
		exit;
	}
}
else {
	// search for matching shortword and redirect upon success
	$location = $shortwords[$q];
	if ($location != "") {
		header("Location: $location");
		exit;
	}
}

// default to google.com
header("Location: http://www.google.com/search?&ie=UTF-8&oe=UTF-8&q=".urlencode($q));

?>



[ Reply to This | # ]
Add Mozilla-like keyword functionality to Safari's search bar
Authored by: zazzman on Mar 05, '06 07:47:45AM

I love this tip! I installed it and was enjoying the Mozilla-like search bar goodness, but then I had to throw a wrench into the works. After doing this tip, I decided to install PHP5 and Apache2.

I used these two tutorials: http://www.phpmac.com/articles.php?view=237 and http://phpmac.com/articles.php?view=214.

Needless to say, Safari doesn't like this tip any more and when I attempt to do it, it just returns an error message saying it can't find search.php.

Thanks for any help you can give!



[ Reply to This | # ]
A much simpler way
Authored by: Gabriel Birke on May 18, '06 10:05:10AM
If you don't want to mess with PHP and personal web sharing and if you have Mac OS X Tiger, you can just install SafariStand (http://hetima.com/safari/stand-e.html")

[ Reply to This | # ]
A much simpler way
Authored by: Stecchino1 on May 18, '07 04:05:38AM

Thanks! SafariStand is great for only intermediate Mac OS X users like me who miss this functionality.



[ Reply to This | # ]
Thanks & a question...
Authored by: Casemon on May 01, '08 07:12:51PM
1st off, thanks for putting this together. I miss keywords from being a long time Firefox user, but prefer Safari for all the reasons it rocks. This is an excellent solution since I didn't care for the SIMBL plugin based solutions (seemed to slow my system & safari launching way down). Here are some more expressions for this solution, just to give a little back:

	"img"   => array("http://images.google.com/images?ie=UTF-8&oe=UTF-8&q=%query%&um=1&sa=N&tab=wi"),
	"news" => array ("http://news.google.com/news?ned=us&hl=en&ned=us&q=%query%&btnG=Search+News"),
	"vid" => array ("http://youtube.com/results?search_type=search_videos&search_query=%query%&search_sort=video_view_count&search_category=0"),
	"vids" => array ("http://video.google.com/videosearch?q=%query%"),
	"hint"    => array("http://www.google.com/search?ie=UTF-8&oe=UTF-8&q=%query%+site:macosxhints.com"),
	"wp"    => array("http://en.wikipedia.org/w/wiki.phtml?search=%query%&go=Go", "ISO-8859-1"),
	"imdb" => array ("http://imdb.com/find?tt=on;nm=on;mx=20;q=%query%"),
	"ebay" => array ("http://shop.ebay.co.uk/?_from=R40&_trksid=m38&_nkw=%query%"),
	"ws" => array ("http://www.wordsmyth.net/live/home.php?script=search&matchent=%query%&matchtype=exact"),
	"stock" => array ("http://www.google.com/search?q=stocks:%query%"),
	"slang" => array ("http://www.urbandictionary.com/define.php?term=%query%"),
	"mono" => array ("http://www.google.com/search?num=50&hl=en&safe=off&q=%query%+site%3Ago-mono.com&btnG=Search&lr="),
	"map" => array ("http://maps.google.com/maps?q=%query%&ie=UTF8&ll=44.837369,-0.576096&spn=0.268285,0.459366&t=h&z=11&iwloc=addr"),

A question after using this solution for a week or so.
a) Is it possible to get the same functionality from the Address bar and not just the search bar? (old habits die hard)

[ Reply to This | # ]
Add Mozilla-like keyword functionality to Safari's search bar
Authored by: Casemon on Jul 04, '08 04:22:27PM
After literally hours (maybe days) of trying to find a solution, it turns out this hint is behind the fact that absent other issues, Safari stops auto-filling passwords.

Maybe there is some checksum verification that fails after replacing the search string with the local url?

Anyway, I hope to find a solution, as I enjoy both "auto-fill passwords" and with this hint "keywords" in my favorite browser.

Have posted the related issue in a new forum post here! If you can help, please do!

[ Reply to This | # ]
Add Mozilla-like keyword functionality to Safari's search bar
Authored by: Casemon on Jul 14, '08 11:32:24PM
Looks like hint breaks password filling in Leopard. A thoughtful forum user suggested it is due to Leopard's Application Signing.

More info here; http://forums.macosxhints.com/showthread.php?p=480384

Any one with solutions to having Keyword support, without losing password filling under Leopard? I just hate to choose between 2 useful features! :)

[ Reply to This | # ]
Add Mozilla-like keyword functionality to Safari's search bar
Authored by: Casemon on Oct 17, '08 07:11:15PM

Just a note; resigning of the Safari binary is necessary to get this working (showing saved passwords, and without prompts everytime) under Leopard.

Was much easier than I first thought and works a treat!



[ Reply to This | # ]
Add Mozilla-like keyword functionality to Safari's search bar
Authored by: Casemon on Mar 06, '09 02:47:28AM

Anyone know how to get this working in Safari 4?

The latest methods (editing the binary, resigning with valid dev signature) no longer work... signing throws an error (where it did not in v3.x)

Like the improvements in Safari 4 but without this beloved keyword functionality, I'm afraid it Safari is useless to me.



[ Reply to This | # ]