Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Let user add your search engine to their Firefox search bar (See related posts)

Built your own queryable search engine? Let FireFox users easily add it to their search box with this on an HTML page:

<a href="javascript:window.sidebar.addSearchEngine('http://yoursrcfile.src','http://yourpngfile.png','Name','Type Of App');">Click here to add my search engine</a>


And you have to make those 'src' and PNG icon files too.. the 'src' file has a syntax like this:

<search name="YourSite" description="" method="GET" 
action="http://www.yoursite.whatever/search" 
searchForm="url-to-your-actual-search-form" queryEncoding="UTF-8" 
queryCharset="UTF-8">
<input name="sourceid" value="FireFox-Search-Box">
<input name="q (or whatever your preferred arg is)" user=""><inputprev>
</search>

<browser update="URL back to this SRC file" updateIcon="URL to your PNG" 
updateCheckDays="30">


More info here.

You need to create an account or log in to post comments to this site.


Click here to browse all 5140 code snippets

Related Posts