Here’s something I did recently and want to share with other Firefox fans out there.
Firefox 2 has a little Search Box built into the browser into which one can type in ones search queries without going to the search engine website. Usually, the default behaviour for the Search Box is to send its query to google.com. When a person does so from a PC in India, the google.com servers automatically redirect the search request to a google.co.in server for localized results.
Now that’s where our problem is. This redirection causes a noticeable and irritating lag which is entirely useless (and unacceptable!). I would be quite fine with results from google.com instead. So is there a way to make the Search Box send its query directly to the google.co.in servers ? Turns out there is !
The Search Box is not very configurable from within the browser itself. The only thing one can do is to add or remove more search engines or change the default serach engine.
However, if you take a moment to navigate to the Firefox 2 installation directory (probably C:\Program Files\Mozilla Firefox\) you’ll see a directory “searchplugins” in there with a file corresponding to each of the installed search engines.
In Firefox 2, the files are .XML files. Google.xml is what seems to be interesting for us at the moment. Open it ! But if you open it with Notepad, the line breaks will not show up properly. So use either Wordpad or Editplus or something similar if you are on Windows.
In case you are using an older version of Firefox, you’ll see an image file which contains the icon for the Search Engine and a .SRC file. Open Google.src in this case.
I’ll proceed assuming that you have the ‘latest and greatest’ version of Firefox, Firefox 2. But the same idea is easily applied to older versions.
Now there are many things in Goolge.xml, but just look at the line with the URL tag,
<Url type=”text/html” method=”GET” template =”http://www.google.com/search”>
Aha ! Change “google.com” in that line to “google.co.in” ! Save the file. And it’s done !
Restart Firefox. Type in a query into the Search Box and feel elated at the reduced latency of your searches. No more redirection is involved from the google.com servers. Yay !
Now for some bonus info. We saw that older versions of Firefox had an image file for the icon and a .SRC file for configuration info. But in the newer version, there is a single .XML file. So where did the icon go ?
The icon is now embedded in the .XML file. But mixing binary image information with textual configuration information can be problematic. So how does one store the icon along with the rest of the configuration data ?
Base64 Encoding can be used for doing that. This kind of encoding is often used to convert binary information into a form that can be stored and transferred in a manner that is compatible with normal text. If you see the contents of the .XML file, you’ll see an <Image> tag which contains the Base64 encoded icon.
Ok. So this does seems a little too easy to be labelled a “hack” at all. But nice enough for majority of the people out there. Maybe I’ll put in something more l33t for all you h4X0rs out there…but that’s for another day.
Until then, enjoy the faster search results !
Did this work for you ?
Got any other Firefox tips and experiences ?
Leave a comment !


November 12, 2006 at 9:03 pm |
Yes, that trick really works. However since you are modifying the contents of the google.xml file itself, when you are auto-updating or updating Firefox, it will fail since the updater checks the files and when it finds google.xml modified it won’t update. Proof of this can be seen while inspecting the update.log file
I also use the same trick, but modify it slightly.
First go to your profile folder.
Default location : C:\Documents And Settings\\Application data\Mozilla\Profiles\XXXXXXXX.default folder
where XXXXXXXX is any random character.
Then look for a searchplugins folder. If no such folder is found then create a new folder with the name searchplugins.
Now copy the google.xml file to the searchplugins folder. open the file (any text editor like wordpad)
At the top of the file find this tag : Google, and replace it with :
Google India (this gives a new name to your search plugin)
Now perform the same replacement in and replace .com with .co.in
Save the file and restart Firefox.
Now open the search Menu option, and you will see Google India listed. Selected that search plugin and continue
December 8, 2006 at 9:05 am |
Hey OJ, N.I.C.E solution.
Worked for me and yes regarding the update,
I think it might give a problem. But till then will enjoy a bit faster
search results.
Thanks pal
December 8, 2006 at 9:06 am |
Great Tip…
However, I m using IE7. There is a similar search box and the same time lag. I was unable to find any plugins folder either in program files or in my profile folder. If you could help me finding it or is there any other way out.
December 8, 2006 at 9:59 am |
Omkara, i like your writing style re. You can become a very successful columnist for “PopularTechieStuff4Everyone” on the lines of “PopularMechanics”. Loss to TechMahindra but gain to the novice techie junta..
December 8, 2006 at 9:34 pm |
@±√∞² ε {φ}
Interesting ! I was unable to try it out myself though since I have Firefox 2 and there are no updates for that out yet AFAIK. Plus, I currently access the net from my work place so I don’t experiment much here. But your post should be helpful to those who face the same problem.
@Don
I would have explored, but my PC at work currently has Windows 2000 which is not supported by IE7. And I have no net access at home. A little Googling might help.
@Gunjan
That’s very encouraging. Thanks ! I’ll try to post something interesting now and then. You can help by recommending my blog to anyone who may be interested.
December 9, 2006 at 1:30 pm |
hey OJ nice topic n d solution…reaaaly gr8 buddy..
December 9, 2006 at 6:15 pm |
itni taklif kyon bhai mere why don’t you use just Internet explorer !!:-)
December 10, 2006 at 12:50 pm |
@Anupam
Reasons to name a few…
1. Because IE isn’t there for GNU/Linux systems which I use now and then
2. Because IE 6 doesn’t have Tabs (How do people manage without tabs ? I have an average of around 10 pages open all the time)
3. Because IE 7 is not compatible with Microsoft’s own OS, Windows 2000 which on my PC at work.
4…N . Because IE 6 doesn’t have ____ (many things here)
…BTW, in case you haven’t used it yet, Firefox 2 is light-years ahead of IE 6 if that is what you are using. Try it out !
December 14, 2006 at 2:11 pm |
so bhai .. you’re part of the free software movement now eh?
theres this guy in my office whoz a phd in comp sc.. reminds me of you…hes into this too … been tryin to convert our office to gnu software but its tough… takes time to shift and update oneself to new skills… im a huge fan of firefox tho…contrary to my big bhaiya
January 14, 2007 at 6:18 pm |
thanks but i don’t get lags..
maybe it’s your internet connection
January 14, 2007 at 6:27 pm |
@Knox
Maybe you are in a country from where redirection does not take place.
April 14, 2007 at 8:47 am |
[...] A Simple Firefox 2 XML Hack [...]
May 2, 2007 at 1:55 am |
Hmm… Gr8 time-saving trick
Thanx buddy
May 2, 2007 at 2:10 am |
For IE7,
Visit ‘Add Search Providers to Internet Explorer 7′ page i.e. http://www.microsoft.com/windows/ie/searchguide/en-en/default.mspx?dcsref=http://runonce.msn.com/runonce2.aspx
Now use the ‘Create Your Own’ section to add Google India
June 2, 2007 at 6:26 pm |
thanks for the tip
visit my website
http://aravinthsk.blogspot.com
October 16, 2007 at 10:29 am |
how ,i can hack my college server ,unblock my block sites
January 26, 2008 at 1:14 pm |
hey OJ gr8 job man…
It works 4 me!!!
Thanx Dude!!!
July 9, 2008 at 2:06 am |
Thanks !
funny thing for the icon : google changed its icon, but my google.xml retains the original icon (and keeps it even with firefox 3, since preferences are kept…)
June 5, 2009 at 4:14 am |
@sap
see this tute:
http://www.a3webtech.com/index.php/view-banned-websites.html