From MozillaWiki
Jump to: navigation, search

In order to help add-on developers learn about add-ons and look for best practices, AMO should make available the source code for add-ons that have allowed their sources to be viewed publicly. Similar to how people learned HTML and JS from "View Source", we can do something similar for add-on authors.

Currently, when an add-on is added to AMO, the developer is asked if they want their sources viewable. If they agree, a link is automatically created (see bottom of this example page).

This proposal is to create a searchable index of all these add-ons

Backend Process

  • Create an empty hg or svn repository/module directory
  • Automatically place all current add-ons that include the "View Source" option in AMO as checked into a repository (perhaps as a nightly batch process)
  • As new add-ons are checked into AMO, automatically update this repo
  • Post process the add-ons
    • Explode the basic packaging - .jar (for themes) and .xpi (for add-ons)
    • Expand the add-on fully (expand all JAR's) - e.g. most add-ons use .jar's to package their chrome/content code
    • Ignore/delete all images? (.png, .gif, .jpg) - not sure if this makes sense

User Interface

  • Setup a web viewable UI against the repo (ViewVC)
  • Setup a module within mxr that allows searching of add-ons
  • Phase 1: Basic source view and search
  • Phase 2: Allow tagging and retrieval of source sections to enable "Add a toolbar" or other common capabilities

Basic Analysis

  • Here's the SQL query:
select count(*) from addons where addons.viewsource = 1 and inactive=0 and status not in (0,2,5);
  • There are currently about 1760 add-ons that are public/sandbox that allow source viewing (out of 6210 total)