by gregr

How do I make a FireFox search plugin?

First go to http://mycroft.mozdev.org/download.html and make sure the plugin
hasnt been made yet.

Now that youve checked that...

In this example Im going to use Urban Dictionary. I went to Urban Dictionary and did
a search. The below url is copied from the address bar on Urban Dictionary.
The basic way the url breaks down is similar to most search engines:

http://www.urbandictionary.com/define.php?term=foo&r=f
|________________________________________|____|___|_|_|
|               Base Url                 | S  | S |E|E|
                                           e    e  t t
                                           a    a  c c
                                           r    r    
                                           c    c    D
                                           h    h    a
                                                     t
                                                S    a
                                                t
                                                r
                                                i
                                                n
                                                g

This is the format for the simplest search plugin possible:
   <search
      name="Site Name"
      description="Description Of Site"
      action="Base Url"
      searchform="Base Url"
      method="GET" >
   <input name="Search" user>
   <input name="Ect" value="Etc Data" >
   </search>

Notice <input name="Search" user> has the word "user". When you do a search with
the plugin the "user" part gets filled in with the searchtext... When you fill it in with the info from the url Urban Dictonary you get this: <search name="Urban Dictionary" description="Urban Dictionary" action="http://www.urbandictionary.com/define.php" searchform="http://www.urbandictionary.com/define.php" method="GET" > <input name="term" user> <input name="r" value="f" > </search>

Save this into a file with the name of the search plugin with the extension
.src, and make/copy a 16x16 pixel logo image and save it as the name of the
search plugin.

Open the directory where FireFox is installed and open the "searchplugin"
directory. Copy the two files you just saved into the searchplugin directory.
Close all instances of firefox and open a new window up and your new search
engine plugin should show up.

 


 
Read more of   The Yak's Frequently Questioned Answers   (mod.2008-11-08)

334.   How can you stop neutrinos?   [strick/2004-07-19]
299.   What does a SPACEWHALE look like?   [strick/2002-01-12]
291.   Should I solder my Sound Card into my computer?   [strick/2002-02-04]
290.   what is the maximum temperature for a socket 370 pentium 3?   [jesse/2001-11-27]
122.   What is the VAXorcist.?   [rupe/2000-09-25]
72.   What happens when you smoke weed every day for a year and then quit cold turkey.   [vonguard/2000-04-04]
44.   What web pages are by VONGUARD?   [strick/2000-02-02]
29.   Where can I find out about the DVD hack?   [strick/2000-02-06]