torsdag 8 november 2012

How To Easily Add A Custom Search Engine To Your Firefox Search Bar

custom-search-engine
How many times have you been frustrated that you have to go to a site just to search for a particular post or article? Wouldn’t it be great if you can search your favorite websites or blogs right from the Firefox search bar? The search bar itself does not provide you with any methods of adding your own search engine. If you want to add one to your search bar, here are some simple and easy methods that you can use. 1) Installing Add to Search Bar extension
Add to Search Bar  is a Firefox extension that allows you to add any search engine to your search bar. Go to your favorite site. Right click on the Search box and select “Add to Search Bar“.
Add to search bar
2) Create your own search engine via Mycroft Project
Mycroft Project is a site created by the Mozdev team that hosts a collection of Sherlock and OpenSearch search engine. It also has a form generator that you can use it to create your own search engine.
Mycroft Project
  • Go to http://mycroft.mozdev.org/submitos.html
  • Fill in the form details
  • If you are not sure what to put in the Search URL field, go to your favorite site and perform a search with the site’s search bar. On the address bar, copy the URL and replace your search term by {searchTerms}. Paste the result into the Search URL field. For example, when you search Make Tech Easier, you will get a URL something like this:
http://maketecheasier.com/about/search-result/?cx=012219648382774935931%3A71v9_lruh3c&cof=FORID%3A11&q=your-search-term
Replace your-search-term by {searchTerms} and you get something like:
http://maketecheasier.com/about/search-result/?cx=012219648382774935931%3A71v9_lruh3c&cof=FORID%3A11&q={searchTerms}
Paste this URL to the Search URL field.
  • Once you have completed the form, scroll down and click on the Generate Plugin button. Code will show up on the text area.
  • Click on the Install Plugin. A window will pop up and ask you if you want to install the search engine in your search bar. 
    install-search-bar
     
  • Click Add. Once you are happy, click Submit Plugin to enter your search engine to Mycroft database.
3) Hacking the backend
If you don’t like to install any extensions as you might feel that it will slow down your Firefox’s performance and you don’t want to submit your search engine to Mycroft, the other way that you can do is to hack the backend of Firefox. Don’t worry, it’s very easy.
  • Open up a text editor.
  • Copy and paste the following to the text editor.
<search
name=”Name_Of_Search_Engine”
method=”GET”
action=”URL_Of_Search_Engine_Result_Page”
queryCharset=”utf-8″
>
<input name=”search_parameter” value=”Value_of_parameter_required_to_carry_out_the_search”>
<input name=”q” user>
</search>
  • Change the Name_Of_Search_Engine to your search engine name.
  • Change the URL_Of_Search_Engine_Result_Page to the search url of the site (without the search parameter)
  • In the input field, enter any relevant search parameter in the search url. Leave the <input name=”q” user> as it is.
  • Save the file and give it a .src extension (for example: your_search_engine.src) 
If you are using Windows, save the file to C:\Program Files\Mozilla Firefox\searchplugins
If you are using Ubuntu, first save the file to the desktop. Open up your terminal and type
sudo cp ~/Desktop/your_search_engine.src /usr/lib/firefox-addons/searchplugins/
If you are using Mac OS X, this method does not work.
Restart your Firefox and you should find your new custom search engine in the search bar
Adding an image to your custom search engine
Create a image of size 16×16 pixels and save it with the same name as your search engine. It doesn’t matter if you save it as jpg, gif or png.
Now copy and paste the image to the same directory where you place the search_engine.src file.
Done!

Inga kommentarer: