Wednesday, January 23, 2008

Mozilla Project Update: Determining Direction - Part I

Mozilla Project: Localized Search in Firefox's Search Box
After doing some initial research, I was uncertain about what direction to take with my project for enhancing, or extending Firefox's existing search box. To help me determine a direction for my project, I searched Bugzilla@Mozilla where I found a number of bugs that were related to my project. I've added some of the more relevant bugs to my project's wiki page. I also spoke with Chris Tyler, Dave Humphrey and consulted with Gavin Sharp through e-mail and on IRC to get some ideas for my project's direction and to determine the scope of my project. From these discussions and communication exchanges, a few ideas emerged.
One idea that emerged was to extend Firefox's search box so that it automatically adds a search engine plugin to the search bar's drop-down list and then propagates the search plugin to the top of the list when the browser encounters a web site that offers a search engine plugin and an OpenSearch description file. From reading some of the bugs at Bugzilla@Mozilla and from personal experience, it appears that most users have a preferred search engine to use as their default search engine so it would be necessary to a) reset the original default search engine on the drop-down list and b) give the user the option to retain the newly added search if it was not originally on the drop-down list. Some further investigation is required to determine if it would be possible to toggle between different search engines on the list if the user has two or more tabs open for different web sites that offer different search engine plugins.
A second idea that came from Gavin was to prototype the feature described in Bug 335448 - Autodetect repeated use of a search field, and ask the user if they want that engine added to the browser search box. This enhancement bug proposes that when Firefox detects that a user has used a particular web site's search box n number of times, the user should be presented with the option to add the web site's search feature to the browser's search bar drop-down list and auto-generate a search engine plugin based on the web page's form elements. Gavin suggested that this would mostly involve implementing an Automatic Detection algorithm and combining it with the search engine addition code from the non-landed patch in Bug 261124 - Textbox context menu should have "Add to Search Bar..." The patch adds search engines to Firefox's search bar given an input field and its associated form element. Potential drawbacks to this enhancement are being able to accurately and consistently auto-generate a search plugin based on a web page's form elements if the names or id's of the elements change, and being able to maintain an accurate account of search box usage if the user clears the browser's private data or the user does not accept cookies from sites.
The third idea was to have the browser detect web site search elements based on names, id's and class names that are commonly used for search input elements, and then use this metadata to generate and add search engine plugins to Firefox's search bar. This approach is very dynamic and fluid but it presents the major problem of being able to accurately and consistently detect search fields based on this type of widely diverse and random metadata.

No comments: