The add-on setup steps come from the extension dev page on MDN. Look there for more details.
- Clone this repo locally:
git clone git@github.com:mozilla/universal-search
- Install the devprefs add-on to enable some Firefox prefs useful for add-on development.
- Create a proxy file to link your local copy of the code to your add-on development profile.
See building.md.
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.
- 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.
Events that flow through the global event broker (app.events
, invoked as
this.events
by individual modules):
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