/universal-search

Test Pilot add-on that inserts server recommendations into the Awesome Bar

Primary LanguageJavaScriptMozilla Public License 2.0MPL-2.0

universal-search

Local Development

First-time Setup

The add-on setup steps come from the extension dev page on MDN. Look there for more details.

  1. Clone this repo locally: git clone git@github.com:mozilla/universal-search
  2. Install the devprefs add-on to enable some Firefox prefs useful for add-on development.
  3. Create a proxy file to link your local copy of the code to your add-on development profile.

Building the Add-ons

See building.md.

Contributing

If you'd like to get involved, take a look at our help wanted bugs, or say hello on IRC (#testpilot on Mozilla IRC) or on our mailing list.

By participating in this project, you agree to abide by our code of conduct.

Coding conventions

  • lib/universal-search.js loads code into windows and constructs the object graph
  • use constructors to assign dependencies to the object, and bind this to callbacks
  • use init for initialization work other than dependency injection
  • use destroy to unset anything that could leak memory
  • leading underscore in prototype methods indicates private API
  • event naming convention: hyphenated lower case.
    • we don't need to namespace it to individual items because it's such a small list of events. just keep it simple.

Pubsub events

Events that flow through the global event broker (app.events, invoked as this.events by individual modules):

urlbar-change

When the user types a printable key in the urlbar, the complete string in the urlbar is fired as the body of this event.

{
  query: 'the mar'
}
  • query: unicode string contents of the urlbar