26290 total geeks with 3498 solutions
Recent challengers:
 Welcome, you are an anonymous user! [register] [login] Get a yourname@osix.net email address 

Articles

GEEK

User's box
Username:
Password:

Forgot password?
New account

Shoutbox
MaxMouse
It's Friday... That's good enough for me!
CodeX
non stop lolz here but thats soon to end thanks to uni, surely the rest of the world is going good?
stabat
how things are going guys? Here... boring...
CodeX
I must be going wrong on the password lengths then, as long as it was done on ECB
MaxMouse
lol... the key is in hex (MD5: of the string "doit" without the "'s) and is in lower case. Maybe i should have submitted this as a challenge!

Donate
Donate and help us fund new challenges
Donate!
Due Date: May 31
May Goal: $40.00
Gross: $0.00
Net Balance: $0.00
Left to go: $40.00
Contributors


News Feeds
The Register
Lego X-wing fighter
touches down in New
York"s Times Square
Experts: Network
security
deteriorating,
privacy a lost
cause
Internet cafés
declared "illegal
businesses" in Ohio
SAP shuffles execs
to chase cloud
success
AT&T adds 61˘
"Mobility
Administrative Fee"
for users
Microsoft caves to
Google, pulls
YouTube app from
WinPhone Store
Amazon expands
Appstore reach,
gives devs more
user data
Now it gets
serious: Fracking
could RUIN BEER
Reports: New Xbox
could DOOM
second-hand games
market
Industry execs:
Network admins an
endangered species
Slashdot
AMD Launches New
Mobile APU Lineup,
Kabini Gets Tested
How To Hack
Twitter"s
Two-Factor
Authentication
African Soil Mapped
For the Very First
Time
BeagleBone Black
Ships With New
Linux 3.8 Kernel
Google Releases
Glass Factory
System Image,
Rooted Bootloader
White House: Use
Metric If You Want,
We Don"t Care
A Snapshot of the
Inside of an Atom
WHO: Intellectual
Property Claims
Hindering Research
On Deadly Novel
Coronavirus
Google Plans
Wireless Networks
In Emerging Markets
Intel Claims
Haswell
Architecture Offers
50% Longer Battery
Life vs. Ivy Bridge
Article viewer

Writing your own Firefox Searchbar Entry



Written by:cyben
Published by:SAJChurchey
Published on:2004-08-23 23:46:09
Topic:General Internet Knowledge
Search OSI about General Internet Knowledge.More articles by cyben.
 viewed 9480 times send this article printer friendly

Digg this!
    Rate this article :
So, you want to add a new search engine, or dictionary, or whatever to your Firefox Searchbar, but to your absolute horror, you find it's not listed on mozdev.org! Erk! Then sit down, read this article, and write it yourself.

What is needed? Your basic search script needs to know what site to look at, what form to fill out, what picture to use, how often to update itself and where to update itself from. Of course, being the nice people that we are, we will satisfy all of the scripts desires; otherwise, it gets cranky, and we don't want that.

So, open up notepad. It is customary to begin your search script with a couple of lines of comments. For these, a comment is any line that begins with a #, so comment away your title, your name, your email adress, and any info that you think anyone who could concievably get their hands on this might want to know. If you're not going to share it, comment anyway. Just do it. I know, 'comments r teh sux!!1', but it's a good habit to get into.

Now, to begin the actual script. Put this in:

<search
   version = "..." //latest version that this has been tested with
   name="..." //whatever it's called
   description="..." //go on, you know you want to!
   method="..." //whatever the form uses (usually "GET")
   action="..." //check the source of the page for the form action
   searchform="..." //the page on which the search-form resides
>


Now, you've got to take a look at the page you're writing this for. What is the form asking? What are the different inputs? Are there some hidden ones? Those need to go in too, but don't forget to give the one you'll be filling in, the search box, its propper name:

<input name="..." user=""> //whatever the input name is for what you'll type
<input name="..." value="..."> //fill in the rest of the form, if needed


I'm not exactly sure why this is necessary, but you also need to supply some information about where on the page you'll go to, where the results are. So, find salient small snippets of the source-code of the resultant site to fill these in. You should tell it where the results start and end, and the items start and end. As an example, I have supplied those used by Google.

<interpret
    resultListStart="<!--a-->"
    resultListEnd="<!--z-->"
    resultItemStart="<!--m-->"
    resultItemEnd="<!--n-->"
>


OK, that's the end of the searching part. Next, let's add a pretty tag on the next line:

</search>


Right. We're almost done. There's just one thing left to do. Perhaps sometime, you'll need to update this script: perhaps the forms on the site will change, perhaps you just noticed a bug. Whatever the reason, you don't want to have to email all your friends and say "hey guys, you gotta download the search thing again. Sorry", do you? And besides, you also want to make a pretty picture. So, one last part:

<browser
   update="http://website.domain/dir/script.src" //full url of where you'll upload this and updates
   updateIcon="http://website.domain/dir/pic.png" //full url of the pretty little pic you'll make
   updateCheckDays="..." //3, or 7, or whatever you want
>


Done! Save that with the extension ".src". Now all we've got to do is make the picture. Try and make it descriptive, but keep in mind that it should be no more than a 16 by 16 pixel PNG. No less either. So make yourself a 16 by 16 pixel PNG, save it, and we're finished.

Now, for the last part: Installing it. There are two ways. First, you can make yourself a webpage with the handy javascript ripped straight from mozdev.org. That way looks cooler. Or, just copy the files into C:Program FilesMozilla Firefoxsearchplugins, or wherever it happens to be on your computer, and restart your browser.

Yay! You're done!

-Cyb.

Note: // in the code signifies my comments for this article. Do not comment lines in that manner within your script!

Did you like this article? There are hundreds more.

Comments:
Obscurity
2004-08-23 23:59:23
Pretty cool article, though I don't use Firefox it's interesting none the less.
oscinis
2004-08-24 03:34:37
was wondering just the other day how to go about doing this :) thanks, cy.
cyben
2004-08-24 11:17:56
Obscurity: what browser d'you use? Negligence of Firefox is one of the eight deadly sins...
Obscurity
2004-08-27 09:11:42
I use IE because Firefox takes too long to load on my box.
bb
2004-08-27 13:16:13
ive just about entirely moved over to firefox now (need IE for some stupid work reasons) mostly because of the articles cyben wrote here!
cyben
2004-08-27 13:38:41
Yay!I've made a difference!
Obscurity: the only reason IE is so fast is because windows preloads it (and just doesn't display it). You can preload firefox too!
Obscurity
2004-08-27 20:45:25
IE is all kernel hooked, I don't think FF is :)
optikal
2004-08-28 17:53:29
i dont think IE has anything to do with the kernel... and if you deleted explorer.exe as i did... no reason for IE :-)
zethyr
2004-12-23 23:39:19
You shouldnt delete IE if you are planning to use other MS-apps, because they all are built into the kernel.
Many people actually thinks this makes IE faster, but it doesnt. The fact is that all the modules IE have to load also contains data for other applications, so it actuallt is slower than a 3rd part browser ;)

I'd definitely take look at FF, or maybe Opera.
http://www.opera.com <-- small install file, LOTS of functions already built in. I dont use it because I find it hard to navigate in that browser, tho...
voodoomagic
2005-02-08 22:34:06
u deleted explorer.exe? that would make your computer not work, since explorer.exe is the program used to display the desktop and everything. to delete ie u want to trash iexplore, but thats not even a proper way to get rid of it, and u shouldnt delete it anyway, because like zethyr said u need it for other ms apps, and for windows update, so deleting it would just close a gateway for becoming secure, which would pretty well not out the whole purpose of getting firefox.
Anonymous
2011-05-31 09:11:28
Practice promotional Apparel akes PerfectThe promotional Children's Clothing saying that practice promotional Costume akes perfect means that after you have plenty of practice in what you are doing, you will promotional Infant & Toddlers Clothing be perfect in it. promotional Intimate Apparel He who practices a lot will master the skill promotional Men's Clothing more quickly
Anonymous
2011-05-31 09:11:44
Practice promotional Apparel akes PerfectThe promotional Children's Clothing saying that practice promotional Costume akes perfect means that after you have plenty of practice in what you are doing, you will promotional Infant & Toddlers Clothing be perfect in it. promotional Intimate Apparel He who practices a lot will master the skill promotional Men's Clothing more quickly
Anonymously add a comment: (or register here)
(registration is really fast and we send you no spam)
BB Code is enabled.
Captcha Number:


Blogs: (People who have posted blogs on this subject..)
sydnie121
Blog entry for Mon 15th Oct 6pm on Mon 15th Oct 6pm
The internet at my school sucks ass everything is blocked
bb
Concert Ticket Generator on Wed 2nd Aug 8am
Someone showed me this hilarious site today for generating your own concert tickets. Concert Ticket Generator Make your own virtual concert ticket Now you never have to admit you missed the show. Just enter some text and click the 'Go' button.


     
Your Ad Here
 
Copyright Open Source Institute, 2006