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-06-12)

437.   How do I wash a feather comforter?   [n0b0dy/2006-08-13]
410.   What is naked sushi? What is Nyataimori? What is Nyotaimori? Or how do I ask for a "Naked Sushi" bar?   [jake/2006-05-21] ( novalis/2005-03-30 )
382.   What is the best combination Sushi Bar / Internet Cafe in Berlin?   [jake/2003-09-25]
366.   What is a really good german street map website?   [jake/2003-07-10]
339.   R. U. ready to Impeach the Entire Political Mainstream and Dramatically Decrease the Threat of International Terrorism?   [strick/2002-12-06]
250.   What's in a Ross Omelette?   [strick/2001-08-07] ( ross/2003-09-16 treesn/2001-12-30 )
226.   How do you eat vegetarian in central Texas?   [combee/2005-04-08]
218.   how do I make my page appear in web search results?   [josh/2001-05-08] ( strick/2001-05-08 )
165.   What's the story with NTSC, PAL, SECAM?   [jss/2001-01-22]
126.   How can I distribute the DeCSS algorithm via DNS?   [rupe/2000-09-28]
110.   How can I download a new ringtone to my SMS capable phone without having net access?   [rupe/2000-07-09]
91.   Should the answer to an FQA consist entirely of an external link?   [macki/2000-05-06] ( strick/2002-01-23 )
78.   Where can I find the latest copy of nmap?   [rupe/2000-04-22]
71.   What was Alex's prisoner number in A Clockwork Orange?   [vonguard/2000-04-04]
53.   Why is strick's favorite composer Dennis Báthory-Kitsz?   [strick/2001-05-13]
41.   Which OS Sucks? Which OS Rules?   [strick/2000-02-02]
39.   Can we get a peek at CRPL?   [strick/2000-02-01]