Archive for the Mozilla Category

Search has become an integral part of our lives and after the advent of Firefox (now IE7 too) the nifty search bar on the top-right seems to be a must have. With the plethora of engines that can be added to the existing list I have never come across the need to define one myself. But sometimes I think, “What if I could add this site to my search bar?”, incase an engine for such site does not exist. Well, here is my three part series on writing your own search engine plugin.

The Unavoidable Basics

The plugin source file is a normal text file with the extension .src. Every plugin starts with the tag,

< search

which has the following attributes,

version=”7.1″

the version indicates the latest version of Netscape against which the plugin was tested successfully. This means that the plugin won’t work for lower versions of Netscape. In Firefox specifying a version=”0.0″ indicates compatibility with all versions.

name=”plugin name”

this signifies the name of your plugin. This is the name visible in the search bar list.

description=”plugin description”

here goes the plugin description.

action=”url prefix”

Now pay attention! We need to examine the search url of the site we are building the plugin of. For example, Google has the search url which looks like “http://www.google.com/search?hl=en&q=semantic+void&btnG=Google+Search….” . The action represents the part of the url before ‘?’. So in our case it would be “http://www.google.com/search”.

searchForm=”form url”

An optional element referring to the form in the search page which submits the search.

queryCharset=”utf-8″

This specifies the charset to which the query belongs. If not specified the default charset of the browser is taken.

method=”GET”

Currently only the GET method is supported. Finally complete the search start tag.

>

Now we must define the search parameters to be passed to the search url.

< input name="query" user>

This represents the term that will be typed in by the end-user. Other parameters can also be passed by specifying another input tag, but they should have fixed values.

< input name="category" value="blog">

Then follows the input tag which is used to let the webmasters know where the search originated from.

< input name="sourceid" value="Mozilla-search">

Having configured the plugin we can now close the search tag.

< / search>

We are all done with creating a search plugin. The plugin source should look somewhat like the following:

< search version='7.1' name="plugin name" description="plugin description" action="url prefix" searchForm="form url" method="GET" >

< input name="query" user>
< input name="sourceid" value="Mozilla-search">

< /search>

You can use the plugin generator I created where you need to just fill in a few values and it spurts out the above code for you.

Incase you are hosting your plugin source somewhere and want the browser to automatically check for updates, you can do this using the browser tag. The browser tag follows after the search tag.

< browser updateIcon="url of plugin icon" updateCheckDays="10" >

The update attribute specifies the url of the plugin source file. The updateIcon specifies the url of the plugin icon if any. The updateCheckDays specifies the interval in days after which the browser should check for the update.

For manually installing the plugin you need to copy the src file into the searchplugins folder in the Firefox directory. The next part will introduce you the gory details.

Server Raping With FireFox

| November 14th, 2005

Although nowdays extensions like FasterFox are now available for tweaking the pipelining properties of FireFox you can manually tweak these settings as explained below. Try it yourself and you’ll never look back to Internet Explorer ever.

1. Type “about:config” into the address bar and hit return. Scroll down and look for the following entries:
network.http.pipelining
network.http.proxy.pipelining
network.http.pipelining.maxrequests

Normally the browser will make one request to a web page at a time. When you enable pipelining it will make several at once, which really speeds up page loading.

2. Alter the entries as follows:
Set “network.http.pipelining” to “true”
Set “network.http.proxy.pipelining” to “true”
Set “network.http.pipelining.maxrequests” to some number like 30. This means it will make 30 requests at once.

3. Lastly right-click anywhere and select New-> Integer. Name it “nglayout.initialpaint.delay” and set its value to “0″. This value is the amount of time the browser waits before it acts on information it receives. If you’re using a broadband connection you’ll load pages MUCH faster now!”

[via]

And by the way opening many server requests and hoggin up the bandwidth is called Server Raping (-;.

[UPDATE]

I have written an extension myself which is not dependent on any libraries. Its called Thunderbolt and you can get hold of it here. Here is the screenshot:

Thunderbolt : Preview

[/UPDATE]

One thing I’ve missed in Linux was the new mail notification of Thunderbird that used to pop up every now and then in Windows. I had to manually check for new mail every now and then which was quite frustrating )-:.

But thats history as this wonderful extension comes to the rescue. Get hold of it here.

Screenshot