Unless you've been living under a rock you probably know that Firefox 2.0 was released today. Although, it seems that someone one on the Mozilla's team is definitely living in a cavern since the
official siteis still linking to FireFox 1.5.
From a developer perspective Firefox 2.0 introduces a number of interesting features, which are explained in detail on the
Firefox 2 for developers site . The thing that attracted my attention was the support for
OpenSearch standard pioneered by A9 (Amazon), something IE7 also supports. The nature of this feature allows you to "push" your own site's search into the browser's search list for the searchbox, thereby providing a neat and consistent way to find content for the user.
This is surprisingly simple to do as you can tell from the excerpts taken from
FUDforum code (yes, the next release will have support for this feature) which you can find at the bottom.
The other very handy addition to Firefox (something Safari had for quite some time) is the integrated spellchecker. However, the spellchecker by-default will only spell check text found within the textarea tag and not offer spelling suggestions for text inside <input type="text">. Fortunately, Firefox provides the means of telling the browser to spell check those as well via the spellcheck="true" attribute that can be added to the input tag or even the encompassing div and span tags. The same tag with the "false" option can be used to prevent spell checking of otherwise checkable form elements. As with the other option, this attribute will be found for relevant input boxes in the next
FUDforum release.
CODE:
<link rel="search" type="application/opensearchdescription+xml" title="{GVAR: FORUM_TITLE} Search" href="{FULL_ROOT}/open_search.php" />
This first block is a link entry that should be located inside your block indicating to a browser that your site supports OpenSearch and where the definition XML file can be found.
How to add OpenSearch Support to your Site
PHP:
<?php header("Content-Type: text/xml; charset=UTF-8"); ?>
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName><?php echo htmlentities($FORUM_TITLE); ?> Search</ShortName>
<Description>Search <?php echo htmlentities($FORUM_TITLE); ?> Messages</Description>
<Image width="16" height="16" type="image/vnd.microsoft.icon">/favicon.ico</Image>
<Url type="text/html" template="<?php echo $WWW_ROOT; ?>index.php?t=search&srch={searchTerms}&eld=all" method="get"/>
</OpenSearchDescription>
This next block, found inside open_search.php is the description of the search and a provider of the URL where the site's search mechanism can be found. The {searchTerms} token will be substituted by the user entered keywords. You also can use the optional
element to provide a url to a favicon.ico image that will be used to put a little identifying mark next to the search option.
And this is all it takes, now when users visits your site they'll have an option temporarily added to their search engine list, which will be your site. At this point they can choose to use or even remember it for future use, allowing them to run searches on your site without having to visit the site first.
JRB Technology on : Developer notes for FireFox 2.0