Search Provider: Difference between revisions

From MozillaZine Knowledge Base
Jump to navigationJump to search
(Created this Tip)
 
No edit summary
Line 1: Line 1:
: ''This article applies to Mozilla Suite.''
: ''This article applies to Mozilla Suite and, possibly, to Mozilla Firefox.''
 
: ''I am a first-time contributer and mozilla modifier, please would a community user come and clean up this post or delete if information is wrong''
 


Want to have complete control over the search engine Mozilla uses? Here's how you can:
Want to have complete control over the search engine Mozilla uses? Here's how you can:


== Create your search file: ==
== Create your search file ==
# Browse to your Mozilla installation path (Default (Windows) ''C:/Program Files/mozilla.org/mozilla'')
# Browse to your installation path (default on Windows is <tt>C:\Program Files\mozilla.org\mozilla</tt>).
# Open the folder ''searchplugins''
# Open the "searchplugins" folder.
# Open google.scr in a '''plain-text editor''' (''notepad, textpad, editpad, etc.'')
# Open "google.src" in a plain-text editor like Notepad, and edit it:
# Now you must '''edit it''':


:First, as this isn't a hosted file delete these two lines:
: First, as this isn't a hosted file delete these two lines:
   update=<nowiki>"http://www.google.com/mozilla/google.src"</nowiki>
   update=<nowiki>"http://www.google.com/mozilla/google.src"</nowiki>
   updateCheckDays=1   
   updateCheckDays=1   
:Now is your time to shine; if you know html forms then this should be simple enough. There are three values you will need to change. Your main two sections to change are:
: Now is your time to shine; if you know HTML forms then this should be simple enough. There are three values you will need to change. Your main two sections to change are:
   method="GET"
   method="GET"
   action=<nowiki>"http://www.google.com/search"</nowiki>
   action=<nowiki>"http://www.google.com/search"</nowiki>
# Method should equal GET or POST (GET means the string is in the address bar POST means the string is transfered to the website's server) GET is right for search engines 99% of the time
# '''method''' should equal GET or POST (GET means the string is in the Location Bar, POST means the string is transfered to the website's server). GET is right for search engines 99% of the time
# Action should equal the serch engine's address (When searching) up to the question mark For instance, when searching google directs you to <nowiki>http://www.google.com/search?q=</nowiki>''search string'' so the value in action is <nowiki>http://www.google.com/search</nowiki>
# '''action''' should equal the URL of the search results page up to the question mark. For instance, when searching Google directs you to <nowiki>http://www.google.com/search?q=</nowiki>''search string'' so the value in ''action'' is <nowiki>http://www.google.com/search</nowiki>


:The third part you need to change is:
: The third part you need to change is:
   <input name="q" user>
   <input name="q" user>
:You need the word/letter(s)/digits between the ? and the = sign. Again, using google as an example, <nowiki>http://www.google.com/search?q=</nowiki>''search string'' so the answer is q. You '''must''' remember to leave the word user in there.
: You need the word/letter(s)/digits between the '''?''' and the '''=''' sign. Again, using google as an example, <nowiki>http://www.google.com/search?q=</nowiki>''search string'' so the answer is '''q'''. You '''must''' remember to leave the word user in there.


Now save as ''"anyname.src"'' (With quote maks so it is not saved as name.src.txt)
Now save the file as "anyname.src" (save with quote marks in Notepad, so it is not saved as "name.src.txt")




== Merging into Mozilla ==
== Merging into Mozilla ==


# Type ''about:config'' into your title bar and click go
# Type ''[[about:config]]'' into your Location Bar and hit Enter.
# In the Filter box type in ''browser.search'' You now have a list of things you can change:
# In the Filter box type in '''browser.search''' You now have a list of things you can change:


:You need to change:<br />
:You need to change:
:'''browser.search.defaultengine''' so it points to your new engine file.<br />
:'''browser.search.defaultengine''' so it points to your new engine file.
:'''browser.search.defaultenginename''' to the search engine you're using.<br />
:'''browser.search.defaultenginename''' to the search engine you're using.
:'''browser.search.defaulturl''' to the url mozilla will go to when there is no inputted search string.
:'''browser.search.defaulturl''' to the URL mozilla will go to when there is no inputted search string.


== You are done ==
== You are done ==
After you re-start Mozilla you will be searching with your chosen engine
After you restart Mozilla you will be able to search with your newly created engine.

Revision as of 19:57, 24 April 2005

This article applies to Mozilla Suite and, possibly, to Mozilla Firefox.

Want to have complete control over the search engine Mozilla uses? Here's how you can:

Create your search file

  1. Browse to your installation path (default on Windows is C:\Program Files\mozilla.org\mozilla).
  2. Open the "searchplugins" folder.
  3. Open "google.src" in a plain-text editor like Notepad, and edit it:
First, as this isn't a hosted file delete these two lines:
  update="http://www.google.com/mozilla/google.src"
  updateCheckDays=1   
Now is your time to shine; if you know HTML forms then this should be simple enough. There are three values you will need to change. Your main two sections to change are:
  method="GET"
  action="http://www.google.com/search"
  1. method should equal GET or POST (GET means the string is in the Location Bar, POST means the string is transfered to the website's server). GET is right for search engines 99% of the time
  2. action should equal the URL of the search results page up to the question mark. For instance, when searching Google directs you to http://www.google.com/search?q=search string so the value in action is http://www.google.com/search
The third part you need to change is:
  <input name="q" user>
You need the word/letter(s)/digits between the ? and the = sign. Again, using google as an example, http://www.google.com/search?q=search string so the answer is q. You must remember to leave the word user in there.

Now save the file as "anyname.src" (save with quote marks in Notepad, so it is not saved as "name.src.txt")


Merging into Mozilla

  1. Type about:config into your Location Bar and hit Enter.
  2. In the Filter box type in browser.search You now have a list of things you can change:
You need to change:
browser.search.defaultengine so it points to your new engine file.
browser.search.defaultenginename to the search engine you're using.
browser.search.defaulturl to the URL mozilla will go to when there is no inputted search string.

You are done

After you restart Mozilla you will be able to search with your newly created engine.