Use Safari's bookmark bar to simulate Camino keywords

Apr 30, '03 10:13:00AM

Contributed by: amit_kr

If you miss Camino/Mozilla keyword bookmarks in Safari, you might find this useful. Take the following template, change a few things, and drag it to your bookmark bar. On a keystroke (Command-digit, where 'digit' is from 1 to 9 for the first nine bookmarks), a dialog will pop up, you can enter your query/text, press enter, and voila! Pseudo-keyword bookmark! Here's the generic template:

javascript:q=prompt('Term:','');location.href='http://your.site.here'+q+'/trailer';
Where +q+ is a stand-in for the %s one enters in Camino keyword bookmarks. You can then populate your bookmark bar with icons and run keyword queries in fewer keystrokes then on Camino. Read the rest of the hint for the JavaScripts I'm using...

Each of the following is one long line, and should be entered without spaces or line breaks.

Kill embeds

javascript:(function()%7Bvar%20d=document;%20function%20K(N,t)%20%7B%20var%20b
%20=%20d.createElement(%22div%22);%20b.style.width=N.width;%20b.style.height=N.height;
%20b.innerHTML=%22%3Cdel%3E%22%20+%20t%20+%20%22%3C/del%3E%22;%20N.parentNode.
replaceChild(b,N);%20%7D%20function%20Z(t)%20%7B%20var%20T%20=%20d.getElementsByTagName
(t),%20i;%20for%20(i=T.length-1;i+1;--i)%20K(T%5Bi%5D,t);%20%7D%20Z(%22object%22);%20Z
(%22embed%22);%20Z(%22applet%22);%20Z(%22iframe%22);%7D)();
Kill Images
javascript:(function()%7Bfunction%20toArray%20(c)%7Bvar%20a,%20k;a=new%20Array;
for%20(k=0;%20k%3Cc.length;%20++k)a%5Bk%5D=c%5Bk%5D;return%20a;%7Dvar%20images,%20img,
%20altText;images=toArray(document.images);for%20(var%20i=0;%20i%3Cimages.length;%20++i)
%7Bimg=images%5Bi%5D;if(img.alt==null)img.alt=%22%20%22;altText=document.createTextNode
(img.alt);img.parentNode.replaceChild(altText,%20img)%7D%7D)();
Send page in email
javascript:location.href='mailto:?SUBJECT='+document.title+'&BODY='+escape
(location.href)
Define word
javascript:q=prompt('Word:%20','');location.href='http://dictionary.reference.com/
search?q='+q';
Visit Yahoo! Group
javascript:q=prompt('Yahoo%20Group:%20','iitd');location.href='http://groups.
yahoo.com/group/'+q+'/messages';
Get Yahoo! Directions
http://maps.yahoo.com/py/ddResults.py?Pyt=Tmap
Of course, this is assuming you don't mind remembering numbers instead of the bookmark keyword, and don't have many bookmarks already...

Comments (13)


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