Mozilla's collection of XPCOM components is large and a world of its own. To write scripts effectively, pick up some of the established jargon used at the scripting level.
Mozilla is a huge piece of software, and regular exploration of features is commonplace. Most Mozilla code and documentation have a particular style that is worth becoming accustomed to. That style appears in the following sources:
The XPIDL definition files that define the existing XPCOM interfaces. These interfaces are help files that you can't do without.
The numerous at-work examples that can be found in the chrome of a built Mozilla application.
Less importantly, the C/C++ source code of the platform. ...