canmove, Confirmed users
2,056
edits
(put the usage info into its own section) |
(better organization) |
||
Line 10: | Line 10: | ||
Components.utils.import("resource://myextension/modules/SomeModule.js", MyExtension); | Components.utils.import("resource://myextension/modules/SomeModule.js", MyExtension); | ||
= Logging = | = Modules = | ||
== Logging == | |||
This is a partial implementation of the Log4* interfaces (for example, see [http://logging.apache.org/log4j/1.2/index.html log4j] or [http://logging.apache.org/log4net/ log4net]). The original implementation came from Michael Johnston, but it was heavily modified by Dan Mills to get it into Weave. | This is a partial implementation of the Log4* interfaces (for example, see [http://logging.apache.org/log4j/1.2/index.html log4j] or [http://logging.apache.org/log4net/ log4net]). The original implementation came from Michael Johnston, but it was heavily modified by Dan Mills to get it into Weave. | ||
Line 56: | Line 58: | ||
* [http://hg.mozilla.org/labs/weave/index.cgi/raw-file/8e3d60172f32/modules/log4moz.js log4moz.js] - Raw (right-click to save) | * [http://hg.mozilla.org/labs/weave/index.cgi/raw-file/8e3d60172f32/modules/log4moz.js log4moz.js] - Raw (right-click to save) | ||
= Observers = | == Observers == | ||
The [http://melez.com/mozilla/modules/Observers.js Observers module] provides an API for observing and sending notifications using the [http://mxr.mozilla.org/mozilla/source/xpcom/ds/nsIObserverService.idl observer service]. | The [http://melez.com/mozilla/modules/Observers.js Observers module] provides an API for observing and sending notifications using the [http://mxr.mozilla.org/mozilla/source/xpcom/ds/nsIObserverService.idl observer service]. | ||
Line 73: | Line 75: | ||
Note: you can use this module to observe notifications generated by any XPCOM component, and you can send notifications whose subject is an XPCOM component, but only JavaScript consumers of this API can send and receive notifications whose subject is an arbitrary JavaScript object. | Note: you can use this module to observe notifications generated by any XPCOM component, and you can send notifications whose subject is an XPCOM component, but only JavaScript consumers of this API can send and receive notifications whose subject is an arbitrary JavaScript object. | ||
= Preferences = | == Preferences == | ||
The [http://melez.com/mozilla/modules/Preferences.js Preferences module] provides an API for accessing application preferences. Getting and setting prefs is easy: | The [http://melez.com/mozilla/modules/Preferences.js Preferences module] provides an API for accessing application preferences. Getting and setting prefs is easy: |