Skip to content

Instantly share code, notes, and snippets.

@dennyhalim
Created July 19, 2009 23:08
Show Gist options
  • Save dennyhalim/150073 to your computer and use it in GitHub Desktop.
Save dennyhalim/150073 to your computer and use it in GitHub Desktop.
function addSearchProvider(uri) {
if ((typeof window.external == "object")
&& (typeof window.external.AddSearchProvider == "function")) {
window.external.AddSearchProvider(uri);
} else {
alert("require browser that support opensearch standard (such as Firefox 2+ or IE 7+) to install");
}
}
<!--
// function installSearchEngine() {
// if (window.external && ("AddSearchProvider" in window.external)) {
// window.external.AddSearchProvider("snurl.com/safersearch");
// }
// }
-->
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<!--
<ShortName>Web Search</ShortName>
<Description>DennyHalim.com search</Description>
<Tags>dennyhalim search</Tags>
<Contact>[email protected]</Contact>
<Url type="application/rss+xml"
template="http://example.com/?q={searchTerms}&amp;pw={startPage?}&amp;format=rss"/>
more detailed format:
<ShortName>Web Search</ShortName>
<Description>Use Example.com to search the Web.</Description>
<Tags>example web</Tags>
<Contact>[email protected]</Contact>
<Url type="application/atom+xml"
template="http://example.com/?q={searchTerms}&amp;pw={startPage?}&amp;format=atom"/>
<Url type="application/rss+xml"
template="http://example.com/?q={searchTerms}&amp;pw={startPage?}&amp;format=rss"/>
<Url type="text/html"
template="http://example.com/?q={searchTerms}&amp;pw={startPage?}"/>
<LongName>Example.com Web Search</LongName>
<Image height="64" width="64" type="image/png">http://example.com/websearch.png</Image>
<Image height="16" width="16" type="image/vnd.microsoft.icon">http://example.com/websearch.ico</Image>
<Query role="example" searchTerms="cat" />
<Developer>Example.com Development Team</Developer>
<Attribution>
Search data Copyright 2005, Example.com, Inc., All Rights Reserved
</Attribution>
<SyndicationRight>open</SyndicationRight>
<AdultContent>false</AdultContent>
<Language>en-us</Language>
<OutputEncoding>UTF-8</OutputEncoding>
<InputEncoding>UTF-8</InputEncoding>
refs
http://blogs.msdn.com/ie/archive/2006/02/07/527266.aspx
http://globalmoxie.com/blog/opensearch-browser-search-field~print.shtml
https://developer.mozilla.org/en/Creating_OpenSearch_plugins_for_Firefox
http://www.opensearch.org/Specifications/OpenSearch/1.1
http://ready.to/search/en/
-->
</OpenSearchDescription>
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>search games, homework research and more</ShortName>
<Description>kiddysurf.blogspot.com safe search. either search for fun games or research your homework, this is the place.</Description>
<Tags>games kids teen parents teacher school research</Tags>
<Contact>[email protected]</Contact>
<Url type="text/html" template="http://www.google.com/cse?cx=003127643427034444210%3Anchtdfnq904&amp;ie=UTF-8&amp;safe=strict&amp;q={searchTerms}&amp;sa=Search"/>
<Url type="application/opensearchdescription+xml"
rel="self"
template="http://snurl.com/safersearch" />
</OpenSearchDescription>
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>wordsearch</ShortName>
<Description>search dozens of dictionary, thesaurus, encyclopedia and more</Description>
<Tags>dictionary encyclopedia thesaurus references teacher school research</Tags>
<Contact>[email protected]</Contact>
<Url type="text/html" template="http://www.google.com/cse?cx=003127643427034444210:4rtzg2gih6q&amp;ie=UTF-8&amp;safe=strict&amp;q={searchTerms}&amp;sa=Search"/>
<Url type="application/opensearchdescription+xml"
rel="self"
template="http://snurl.com/word-search" />
</OpenSearchDescription>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment