Browser Window

From MozillaWiki
Jump to: navigation, search

Introduction

Several elements of the browser front end code are what could optimistically be described as a sewer. The main browser javascript file has for the past six years been a poorly thought out, dumping ground. We have all contributed. The browser code in general is hard to follow, lightly if at all documented, and miserable for extension developers.

We have also discovered limitations of the <tabbrowser/> widget (though I want to point out its limitations are not related so much to code quality as intent-vs.-use and lack of documentation) - it is difficult to extend and embellish.

As a result, I would like us to embark on an adventure to fix this code. This involves:

  • identifying target uses
  • auditing the existing code for behavior
  • developing a general design for the new browser
  • incrementally refactoring existing code to achieve this design

Link title--LORI 01:31, 27 December 2006 (PST)


link title=== Browser Uses ===

  1. Clearly identified ways of inserting per-tab content. (e.g. InfoBars)
  2. Clearly identified ways of attaching progress listeners to tabs
  3. Ability to listen for new tab creation/tab removal etc. (basically an interface to allow clients - whether they be XUL UI or completely external to detect for new content windows and hook into them)
  4. Clear integration points for extension menuitem insertion into menus
  5. Simple, well-documented code that encourages the same from our extension development community.

Stages

Code Audit

Tasks

  1. Kill nsBrowserInstance
    The browser "appCore" appears to be used for nothing more these days than the Page Cycler, which is used by some tinderbox tests. The Page Cycler should be redeveloped as an extension, and this dependency on xpfe/ excised completely.
  1. Organize Event Handlers
  1. Organize Components
  1. Organize Pref Observers

Other Things

Some other things that need to be done elsewhere in the codebase to generally make the browser better from an extensibility and code quality point of view:

  1. Improve the Search Service (sherlock files in profile, support postdata, more attributes, better management, no advanced search service cruft)
  2. Improve the <toolbar/> widget and its customization capabilities - especially for extensions