Friday, August 9, 2013

Firefox: Get results from your favorite Google country domain


Firefox's default search bar gets its configuration options (what search engine to use, what parameters to pass, etc.) from XML files located in 'searchplugins' directory in Firefox’s default directory. If you are on a Windows system this most probably be 'C:\Program Files\Mozilla Firefox\browser\searchplugins'. There's an XML file for Google called 'google.xml'.To modify it follow the following steps (I am doing it for google.co.in, you can replace it as per your requirement): 
  1. The XML tags in this file are self-explanatory. First copy google.xml and make a new one, let's call it 'google_india.xml' (you should have admin rights on your Windows OS).
  2. Edit 'ShortName' tag content and rename it to something else, for example, Google India.
  3. Then there are two 'Url' tags. Leave the first 'Url' tag as it is get search suggestions (though never seen it work as I am behind a firewall). In the second tag change template attribute to template="https://www.google.co.in/search" (or whatever you find useful).
  4. Change https://www.google.com/ to https://www.google.co.in within '<SearchForm>' tag. This specifies the page to display if you click on the magnifying glass icon, at the left hand corner of the search bar, without any search terms.
  5. Now restart your Firefox browser and make the newly added Google search engine as default.
 Credits: