mozdev.org

Mycroft[boxes]

bullet Users: Home | Search | Uninstall | Requests | Contact | Hosting plugins
bullet Developers: Contribute | Submit Plugins | Judge Plugins | Broken Plugins | Mailing List | Bugs
bullet Documentation: Table of Contents | Quick Start | Introduction | Installing | Header | <SEARCH> | <INPUT> | <INTERPRET> | <BROWSER> | Icons | Additional Documentation

Advanced Mozilla-Search Plugin Documentation

Back to Main Table of Contents

Introducing the Mozilla-Search plugin.

Mozilla-Search plugins are based on Apple's Sherlock specification with a few extensions. Plugins written for Mozilla-Search should also work with Apple's Sherlock application, if you wish to support both. You need only test your plugin with a Mozilla based browser to submit your plugin to the Mycroft Project. If you wish to add support for Apple's Sherlock application in your plugin please read the optional Apple Sherlock support section.

Top^

Simple plugin examples

The typical Mozilla-Search plugin falls somewhere in between a simple plugin and an advanced plugin. The following is an example of a simple Mozilla-Search plugin.

# AltaVista Sherlock for Mozilla
#
# juliusross at mac dot com June 2002
#
# Known issues:
# This plugin will not detect searches performed directly on
# the Altavista web page.
#
# The plugin could easily be altered to particular language and/or
# region searches

<search
name="AltaVista"
description="AltaVista - THE SEARCH COMPANY"
action="http://www.altavista.com/sites/search/res_text"
searchForm="http://www.altavista.com/sites/search/res_text"
method="GET" >

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

<interpret

resultListStart="<!-- RESULT LIST START -->"
resultListEnd="<!-- RESULT LIST END -->"

resultItemStart="<!-- RESULT ITEM START -->"
resultItemEnd="<!-- RESULT ITEM END -->"

# relevanceStart="<!-- RELEVANCE START -->"
# relevanceEnd ="<!-- RELEVANCE END -->"

>
</search>

<browser
Update="http://mycroft.mozdev.org/update.php/id0/Altavistatxt.src"
updateIcon="http://mycroft.mozdev.org/update.php/id0/Altavistatxt.gif"
updateCheckDays="7"
>

The example shown above is an actual plugin for the search site AltaVista. It is a good example of a plugin for a site that uses easily configured search tags. We recommend site administrators make use of these search tags in their search results. For more information on these special search tags please read Apple's Tips for Search Site Administrators.

Top^

Advanced plugin examples

The following source files are examples of some of the advanced things you can do with Mozilla-Search plugins. Most search sites won't require the amount of coding involved in these plugins; however, if your search site can support some of the advanced options in Mozilla-Search you and the users of your plugin can benefit greatly from the usage of advanced coding.

# Status: Working
# Mozilla/Netscape 6+ plugin file for buy.com by Matthew A. McGuigan <webnugget.com>
#
# Created: June 21, 2002
# Last updated: Aug 18, 2002
#
# Known issues:
#
# 1. There are several bugs in the code for the Next and Previous buttons; therefore, they
# are not turned on. Where possible Next and Previous links will show in the sidebar with
# the search results.
# 2. Next and Previous buttons can not be used with this plugin until the start value can be
# customized.
#
<search
name="buy.com"
description="Search buy.com - The Internet Superstore."
action="http://www.buy.com/retail/searchresults.asp"
searchForm="http://www.buy.com/retail/searchresults.asp"
method="GET" >

<input name="qu" user >
<input name="sourceid" value="Mozilla-search">
# <inputnext name="pagereq" factor="1">
# <inputprev>

<interpret
# category on main search result page.
browserResultType = "category"
bannerStart="</div></td><td>"
bannerEnd="categoryName"
resultListStart="<!-- ========== End Microplacemants =============== -->"
resultListEnd="</table></td></tr></table"
resultItemStart="</span>&nbsp;&nbsp;&nbsp;&nbsp;"
resultItemEnd="<b>Price</b>"
>

<interpret
# result on main search result page.
browserResultType = "result"
bannerStart="</div></td><td>"
bannerEnd="categoryName"
resultListStart="<!-- ========== End Microplacemants =============== -->"
resultListEnd="</table></td></tr></table"
resultItemStart="&nbsp;&nbsp;&nbsp;&nbsp;</td>"
resultItemEnd="</b></span>"
priceStart="<b>$"
priceEnd="</b>"
>

<interpret
# result on sub category search result pages.
browserResultType = "result"
resultListStart="Results"
resultListEnd="</table></td></tr></table"
resultItemStart=".&nbsp;"
resultItemEnd="productDescription"
priceStart="<b>$"
priceEnd="</b>"
availStart="Availability:&nbsp;&nbsp;"
availEnd="Manufacturer:"
>
</search>
<BROWSER
alsomatch="http://www.buy.com/retail/clearance/searchresults.asp"
update="http://mycroft.mozdev.org/update.php/id0/buycom.src"
updateIcon="http://mycroft.mozdev.org/update.php/id0/buycom.png"
updateCheckDays="7"
>

The example shown above is an actual plugin for searching the buy.com web site. It is a good example of a plugin for a site that needs multiple interpret tags.

We recommend that you browse through the channels supported by Mozilla-Search in the <INTERPRET> tag information section for the type of site your plugin will support.

# GoogleUK Search plug-in for Mozilla/Netscape 6+
# by amitp at google dot com
# modified by wolfgang dot schroedl at gmx dot net and juliusross at mac dot com

# Last updated: 28 June 2002

# This plugin can be altered so that it can
# (a) search using any of the google mirrors
# (b) restrict your search to sites from a particular country
# (c) restrict your search to sites in a particular language

# Known issues:
# 1. The previous/next buttons have been disabled.

<search
name="Google"
description="Google Search"
method="GET"

#################################################
# #
# Choosing a google mirror #
# #
#################################################
#
# To use google from a particular country remove the line
# which says
#
# action="http://www.google.com/search"
#
# and uncomment the appropriate "action" line by removing
# the leading "#".
#
# Note: If you also want to restrict your search to
# sites from a particular country then see below.


action="http://www.google.com/search"


#action="http://www.google.de/search"
#Deutschland

#action="http://www.google.fr/search"
#France

#action="http://www.google.co.uk/search"
#the UK

#action="http://www.google.co.jp/search"
#Japan

#action="http://www.google.co.kr/search"
#Korea

#action="http://www.google.it/search"
#Italia

#action="http://www.google.ch/search"
#der Schweiz

#action="http://www.google.ca/search"
#Canada

#action="http://www.google.co.il/search"
#Israel

#action="http://www.google.nl/search"
#Nederland

#action="http://www.google.be/search"
#Belgium

#action="http://www.google.cl/search"
#Chile

#action="http://www.google.com.ar/search"
#Argentina

#action="http://www.google.com.pa/search"
#Panama

#action="http://www.google.at/search"
#Austria

#action="http://www.google.com.pl/search"
#Polska

#action="http://www.google.com.ru/search"
#Russian Federation

#action="http://www.google.com.br/search"
#Brasil

#action="http://www.google.co.nz/search"
#New Zealand

#action="http://www.google.vg/search"
#Virgin Islands

#action="http://www.google.bi/search"
#Burundi

#action="http://www.google.cc/search"
#Cocos Islands

#action="http://www.google.li/search"
#Liechtenstein

#action="http://www.google.lt/search"
#Lietuvos

#action="http://www.google.mw/search"
#Malawi


#action="http://www.google.fm/search"
#Micronesia


#action="http://www.google.ms/search"
#Montserrat

#action="http://www.google.com.nf/search"
#Norfolk Island

#action="http://www.google.sh/search"
#Saint Helena

#action="http://www.google.cd/search"
#Rep. Dem. du Congo

#action="http://www.google.co.gg/search"
#Guernsey

#action="http://www.google.co.je/search"
#Jersey

#action="http://www.google.co.cr/search"
#Costa Rica

#action="http://www.google.lv/search"
#Latvija


>

# There are several bugs in the code for the Next and Previous buttons; therefore, they are disabled
#<inputnext name="start" factor="20">
#<inputprev name="start" factor="20">

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


#################################################
# #
# Setting the number of hits #
# #
#################################################
#
# You may change the number below if you want

<input name="num" value="20">


#################################################
# #
# Restricting your search to sites in #
# a particular language #
# #
#################################################
#
# To restrict your search to sites in a particular language
# uncomment one of the following lines by removing the leading "#"
# from the appropriate <input> line.
#



#<input name="lr" value="lang_ar">
# Arabic

#<input name="lr" value="lang_bg">
# Bulgarian

#<input name="lr" value="lang_ca">
# Catalan

#<input name="lr" value="lang_zh-CN">
# Chinese (Simplified)

#<input name="lr" value="lang_zh-TW">
# Chinese (Traditional)

#<input name="lr" value="lang_hr">
# Croatian

#<input name="lr" value="lang_cs">
# Czech

#<input name="lr" value="lang_da">
# Danish

#<input name="lr" value="lang_nl">
# Dutch

#<input name="lr" value="lang_en">
# English

#<input name="lr" value="lang_et">
# Estonian

#<input name="lr" value="lang_fi">
# Finnish

#<input name="lr" value="lang_fr">
# French

#<input name="lr" value="lang_de">
# German

#<input name="lr" value="lang_el">
# Greek

#<input name="lr" value="lang_iw">
# Hebrew

#<input name="lr" value="lang_hu">
# Hungarian

#<input name="lr" value="lang_is">
# Icelandic

#<input name="lr" value="lang_id">
# Indonesian

#<input name="lr" value="lang_it">
# Italian

#<input name="lr" value="lang_ja">
# Japanese

#<input name="lr" value="lang_ko">
# Korean

#<input name="lr" value="lang_lv">
# Latvian

#<input name="lr" value="lang_lt">
# Lithuanian

#<input name="lr" value="lang_no">
# Norwegian

#<input name="lr" value="lang_pl">
# Polish

#<input name="lr" value="lang_pt">
# Portuguese

#<input name="lr" value="lang_ro">
# Romanian

#<input name="lr" value="lang_ru">
# Russian

#<input name="lr" value="lang_sr">
# Serbian

#<input name="lr" value="lang_sk">
# Slovak

#<input name="lr" value="lang_sl">
# Slovenian

#<input name="lr" value="lang_es">
# Spanish

#<input name="lr" value="lang_sv">
# Swedish

#<input name="lr" value="lang_tr">
# Turkish


#################################################
# #
# Restricting your search to sites in #
# a particular country #
# #
#################################################
#
# To restrict your google search to a particular country
# uncomment one of the following lines by removing the leading "#"
# from the appropriate <input> line.
#


#<input name="cr" value="countryAT">
# Austria

#<input name="cr" value="countryAU">
# Australia

#<input name="cr" value="countryBE">
# Belgium

#<input name="cr" value="countryBR">
# Brazil

#<input name="cr" value="countryCA">
# Canada

#<input name="cr" value="countryCN">
# China

#<input name="cr" value="countryCZ">
# Czech Republic

#<input name="cr" value="countryDK">
# Denmark

#<input name="cr" value="countryDE">
# Germany

#<input name="cr" value="countryUK|countryGB">
# Great Britain

#<input name="cr" value="countryFR">
# France

#<input name="cr" value="countryFI">
# Finland

#<input name="cr" value="countryIT">
# Italy

#<input name="cr" value="countryJP">
# Japan

#<input name="cr" value="countryKR">
# Korea

#<input name="cr" value="countryNL">
# Netherlands

#<input name="cr" value="countryNO">
# Norway

#<input name="cr" value="countryPL">
# Poland

#<input name="cr" value="countryRU">
# Russian Federation

#<input name="cr" value="countryES">
# Spain

#<input name="cr" value="countrySE">
# Sweden

#<input name="cr" value="countryCH">
# Switzerland

#<i nput name="cr" value="countryTW">
# Taiwan

#<input name="cr" value="countryUK">
# United Kingdom

#<input name="cr" value="countryUS">
# United States




<interpret
browserResultType="result"
resultListStart="<!--a-->"
resultListEnd="<!--z-->"
resultItemStart="<!--m-->"
resultItemEnd="<!--n-->"
>
</search>

<BROWSER
alsomatch="'http://www.google.com/search','http://www.google.de/search','http://www.google.fr/search','http://www.google.co.uk/search','http://www.google.co.jp/search','http://www.google.co.kr/search','http://www.google.it/search','http://www.google.ch/search','http://www.google.ca/search','http://www.google.co.il/search','http://www.google.nl/search','http://www.google.be/search','http://www.google.cl/search','http://www.google.com.ar/search','http://www.google.com.pa/search','http://www.google.at/search','http://www.google.com.pl/search','http://www.google.com.ru/search','http://www.google.com.br/search','http://www.google.co.nz/search','http://www.google.vg/search','http://www.google.bi/search','http://www.google.cc/search','http://www.google.li/search','http://www.google.lt/search','http://www.google.mw/search','http://www.google.fm/search','http://www.google.ms/search','http://www.google.com.nf/search','http://www.google.sh/search','http://www.google.cd/search','http://www.google.co.gg/search','http://www.google.co.je/search','http://www.google.co.cr/search','http://www.google.lv/search'"
update="http://mycroft.mozdev.org/update.php/id0/google.src"
updateIcon="http://mycroft.mozdev.org/update.php/id0/google.gif"
updateCheckDays="7"
>

The example shown above is an actual plugin for the search site Google. It is a good example of a plugin that is highly customize able and is used as a template for supporting the various countries and languages that a site like Google provides.

If your search site supports multiple countries or languages it is a good idea to write your code in such a way that you or the user can easily provide support for those different countries and languages.

Top^ Back to Main Table of Contents Next>

User Contributed Notes for this section

Have a useful tip or trick to add to this section? You can use the form below to add your comment to the user contributed notes.

If you find something that no longer works, is invalid, or is no longer needed. Please let us know by contacting us through the Mycroft Mailing List.

Please do not place corrections in the user notes section, it is for helpful tips and tricks only.

Have you found and documented a feature that is not documented in these pages? Send it to us for inclusion in these documents and we will add your name to the list of contributors for this document.

User Notes: [?]

If you do not get a response to a question posted in this forum, please try sending a message to the project's mailing list or to the project owner directly.

[1] Submitted by: Ma on Friday October 24th 2003

Please can google.co.th and countryTH and lang_th please be included in the /plugins.google.src - thanks!!!

[2] Submitted by: rsdno on Saturday 3rd December 2005 at 01:22 -0500

Where are all the Search Plug Ins like the ones from Colleges Sirius you have so many but I cant find them PLEASE ,Thank You rsdno@gmail.com

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5
[3] Submitted by: pooja on Tuesday 14th March 2006 at 06:26 -0500

i dont want that '?' symbol in url
what to do for that

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050925 Firefox/1.0.4 (Debian package 1.0.4-2sarge5)
[4] Submitted by: rsdno on Friday 28th April 2006 at 18:42 -0400

Hi Hpw come I cant find the place where I can click on to all the Search Engines my addy is rsder1@gmail.com or rsdno@msn.com if they are no longer able to be accessed I would be wasting my time here as much as I like Firefox and Stumbleupon so please help me rsdno

Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
[5] Submitted by: Charles at Mycroft on Saturday 29th April 2006 at 14:38 -0400

rsdno, I'm not quite sure what you mean.
There is a link to the advanced search page at the top of all pages called 'Search' - http://mycroft.mozdev.org/install.html if you enter the domain (eg example.com) and hit search then you will see if there is a search plugin already.
If you need more help then email me at mycroft.mozdev.org AT googlemail.com

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.0.2) Gecko/20060308 Firefox/1.5.0.2
[6] Submitted by: Tamara on Sunday 30th April 2006 at 17:09 -0400

Is there a way that the google feature "site:" can be integrated to the code for the google search engine?

I don't mean it to be used by the user when he performs a search, but to create a site-specific search engine for any site, regardless if they have their own search, or a method other than GET.

In google, when a user writes in the search field:

query site:www.somesite.com

google only searches for "query" on the site "www.somesite.com".

I was wondering if this feature could be implemented to create site-specific plugins for any site, as I said before.

Thanks for the help!

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.2) Gecko/20060308 Firefox/1.5.0.2
[7] Submitted by: Waldo on Monday 8th January 2007 at 01:43 -0800

How do you add the auto-detect search plugin feature to a site? The FF2 Search Engine bar glows blue when I am on this site indicating that there is a search engine plugin available for this site. I want to add this functionality to our site too.

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1
[8] Submitted by: ignacio alvestegui on Monday 8th January 2007 at 07:05 -0800

thanks for helping me.

Mozilla/5.0 (Macintosh; U; PPC Mac OS X; ay) AppleWebKit/418.9.1 (KHTML, like Gecko) Safari/419.3
[9] Submitted by: Waldo on Monday 8th January 2007 at 20:50 -0800

Never mind ... I found my answer

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1
[10] Submitted by: LouCypher on Tuesday 9th January 2007 at 06:50 -0800

Just in case

http://developer.mozilla.org/en/docs/Creating_OpenSearch_plugins_for_Firefox#Autodiscovery_of_search_plugins

Mozilla/5.0 (PLAYSTATION 3; 2.00)
[11] Submitted by: Mark0 on Thursday 24th May 2007 at 02:45 -0700

It's possible to point a search to an (mod_rewritten) URL instead of a form?

That is, I wish to make the FF search plugin point to:
http://mysiteblabla.com/seeker/filename_extension_cab.html
instead of:
http://mysiteblabla.com/seeker/seeker.cgi?ext=cab

Thanks,
Bye!

Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3

Contact the Mycroft Project at mycroft.mozdev.org AT googlemail.com or see other options.
Copyright © 2000-2008. All rights reserved. Terms of Use & Privacy Policy.