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.2010-02-10)

427.   What is ego surfing?   [jake/2006-01-21]
415.   what is a tabulator   [ross/2004-10-17]
366.   What is a really good german street map website?   [jake/2003-07-10]
360.   How can I keep my Alcohol-Laced Yak Beverage cold on a hot, sunny day?   [goodwill/2003-06-02]
352.   Where can I see an example of looping code in G and in C?   [jake/2003-02-26]
349.   Hey my money just got ripped off by my bank. They said I made a debit but I didn't!   [jake/2003-02-21]
329.   How do I get music for my experimental noise club?   [jake/2002-10-05]
327.   What is a great little script to use when airboxing (wardriving, warchalking, etc)   [jake/2002-10-05]
322.   how do i verify an address in sendmail?   [jesse/2002-08-30]
319.   why do i get an error "make: don't know how to make /usr/share/tmac/tmac.andoc. Stop" when building a pkg on netbsd?   [jesse/2002-08-10]
310.   whats the easiest way to build apache 1.x with lots of modules?   [jesse/2002-04-28]
***306.   What are the niftiest unicode alphabets?   [strick/2010-02-10]
273.   Where do I find a free comma delimited file with all USA zipcodes, including longitude and latitude?   [les/2001-09-06]
261.   Which companies belong to the DVD Copy Control Association (DVD CCA) as of 08-2001?   [rupe/2001-08-03]
260.   What is the best language to search google with?   [kurt/2001-07-23]
255.   why is the text on some website(such as kernel.org) unreadable in konqueror at the default font size?   [jesse/2001-07-09]
236.   how do i setup a scroll wheel mouse in xfree86 4.0.x?   [jesse/2001-06-09]
164.   what are the first 4096 digits of the numerical constant PI?   [jesse/2001-01-17]
152.   Why is it that Slackware roolz all other Linux distributions?   [dice/2000-12-10] ( jake/2003-09-22 )
123.   How do I check for the existence of a file in Python?   [rupe/2000-09-25]
99.   Can I legally use electronic countermeasures on my vehicle in California?   [rupe/2000-05-23]
1.   From whom did The Yak borrow the idea of Frequently Questioned Answers?   [strick/2000-01-19]