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 Related Projects: Add to Search Bar | OpenSearchFox | Dictionary Search | Context Search | ConQuery | NeedleSearch | Google Toolbar

Instructions for hosting Search Engine Plugins

This is a slightly simplified version of the method used on Mycroft.
Please feel free to modify as you find necessary.
There is further information at the Mozilla Developer Center.

Hotlinking to Mycroft

This is fine for Javascript installation as per the below example (please use external(os).php not install(os).php or update(os).php) However, please do not link directly to Mycroft when using the Autodiscovery capabilities of OpenSearch as it requests the OpenSearch description on each page load. Instead, host a copy of the xml description at http://example.com/opensearch.xml and use http://example.com/favicon.ico in the <image> tag.

Backend javascript

function addEngine(name, ext)
{
  if ((typeof window.sidebar == "object") && (typeof window.sidebar.addSearchEngine == "function")) {
    window.sidebar.addSearchEngine(
      "http://mycroft.mozdev.org/external.php/" + name + ".src",
      "http://mycroft.mozdev.org/external.php/" + name + "."+ ext, "", "");
  } else {
    alert("You will need a browser which supports Sherlock to install this plugin.");
  }
}

function addOpenSearch(name,ext,meth)
{
  if ((typeof window.external == "object") && ((typeof window.external.AddSearchProvider == "unknown") || (typeof window.external.AddSearchProvider == "function"))) {
    if ((typeof window.external.AddSearchProvider == "unknown") && meth == "p") {
      alert("This plugin uses POST which is not currently supported by Internet Explorer's implementation of OpenSearch.");
    } else {
      window.external.AddSearchProvider(
        "http://mycroft.mozdev.org/externalos.php/" + name + ".xml");
    }
  } else {
    alert("You will need a browser which supports OpenSearch to install this plugin.");
  }
}

Installation links

<a href="#" onClick="addOpenSearch('mycroft','png','g');return false">Mycroft Project - All</a>
<a href="#" onClick="addEngine('mycroft','png');return false">Mycroft Project - Sherlock</a>

OpenSearch autodiscovery

<link rel="search" type="application/opensearchdescription+xml" title="Mycroft Project" href="http://mycroft.mozdev.org/opensearch.xml">

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.