Jon the Geek: Multi-Parameter Firefox Keywords and Chrome Search Engines
By far, my most popular post is my guide on Firefox Keywords and Chrome Search Engines. I recommend reading that one to get caught up if you don't know what Firefox Keywords and/or Chrome Search Engines are.
Shortly after I wrote that, I found this post on Lifehacker explaining how to combine bookmarklets and keywords for some very clever and useful tricks, but it didn't work on Chrome as written, and I never got around to figuring it out. Tonight I finally took the time to figure it out.
The problem (besides the Lifehacker example being overly complicated) is that Chrome doesn't like {}'s in keywords. Those aren't really necessary unless your keywords are very complicated, though, so I got it to work. This is the code we'll be working with:
javascript:
var s='%s';
url='YOUR URL, WITH %s's FOR EACH TERM';
query='';
urlchunks=url.split('%s');
schunks=s.split(';');
for(i=0; i<schunks.length; i++)query+=urlchunks[i]+schunks[i];
location.replace(query);
As it says in the code, all you need to do is insert the url you want to use, with the usual %s's anywhere you want to insert a search term. You then set it up like any other keyword or search engine (see the other post for how to do that; note: you can just copy/paste the multi-line code into Chrome or Firefox, they don't require that you condense it down to one line first). To use it, just separate your search terms with ;'s.
Read full article from Jon the Geek: Multi-Parameter Firefox Keywords and Chrome Search Engines
No comments:
Post a Comment