Free Newsletters
Technology & Business Daily

InfoWorld
Log-in | Register

  Thursday, March 11, 2004 

More Firefox search plugins

I've added a few more search engines to Firefox, and I'm parking them here so I can easily transfer them to my other machines.

Here's the procedure create these plugins, by the way:

  1. Capture the image. To do this I fetch the favicon.ico file from the site's root, and use ImageMagick to convert it to a GIF.

  2. Write the control file. For example:

    <search 
       name="Feedster"
       method="GET"
       action="www.feedster.com/search.php" >
    <input name="q" user>
    </search>
    
    The action is the query URL minus the query parameter(s), in this case "q" -- it goes separately as part of the <input> tag. When a site uses POST instead of GET, you'll need to dig a bit deeper to come up with the query string. I used to use the LiveHTTPHeaders extension. Even better, though, is Chris Pederick's wonderful Web Developer Extension which does all kinds of handy things, including converting between GETs and POSTs.

To add a plugin, just drop a pair of these files -- the image and the control file -- into Firefox's searchplugins directory. The additional step I'm illustrating here -- one-click installation of the plugin -- depends on a snippet of JavaScript:

function addEngine(name,ext,cat)
{
  if ((typeof window.sidebar == "object") && (typeof
  window.sidebar.addSearchEngine == "function"))
  {
    window.sidebar.addSearchEngine(
      "http://weblog.infoworld.com/udell/gems/"+name+".src",
      "http://weblog.infoworld.com/udell/gems/"+name+"."+ext,
      name,
      cat );
  }
  else
  {
  alert("Netscape 6 or Mozilla is needed to install a search plugin");
  }
}

Note that there's a registry of these plugins. And I should probably register the Safari Books Online plugin there. But I'm sure this blog isn't searched often enough to warrant registering a "Jon's Radio" Firefox plugin. For such cases, it's nice to know that a more decentralized, ad-hoc solution is available.

Update: One reader wondered where the search plugin dropdown list is hiding. In plain sight. Though I'll agree it's easier to miss than Safari's equivalent, which remembers search history. Hmm. Would it make sense to offer both funtions? One handle to drop down the list of engines, and another to drop down the recent searches for that engine. Nah. Too cluttered, probably.

Update #2: I screwed up the original Safari Books example, by forgetting that the non-interactive parameters need to be listed separately, rather than appended to the action, like so:

<search 
   name="Safari Books Online"
   method="GET"
   action="safari.oreilly.com/JVXSL.asp">
 
<input name="s" value="1">
<input name="o" value="1">
<input name="t" value="1">
<input name="f" value="1">
<input name="c" value="1">
<input name="u" value="1">
<input name="l" value="1">
<input name="view" value="book">
 
<input name="srchText" user>
 
</search>
So if you actually wanted to use that one, reload it.

 


Recent Entries


















































Sponsored Technology Links

 
 
 HOME  NEWS  BLOGS  PODCASTS  VIDEOS  TECHNOLOGIES  TEST CENTER  EVENTS  CAREERS   About | Advertise | Awards | RSS | Contact Us 

Copyright © 2008, Reprints, Permissions, Licensing, IDG Network, Privacy Policy, Terms of Service.
All Rights reserved. InfoWorld is a leading publisher of technology information and product reviews on topics including viruses,
phishing, worms, firewalls, security, servers, storage, networking, wireless, databases, and web services.

CIO :: ComputerWorld :: CSO :: Demo :: GamePro :: Games.net :: IDG Connect :: IDG World Expo
Industry Standard :: IT World :: JavaWorld :: LinuxWorld :: MacUser :: Macworld :: Network World :: PC World :: Playlist