api-utils

Author Atul Varma (http://toolness.com/) <atul@mozilla.com>
License MPL 2.0
Dependencies addon-kit
Modules api-utils app-strings base64 byte-streams collection content content/loader content/proxy content/symbiont content/worker cortex cuddlefish environment errors event/core event/target events file frame/utils globals heritage hidden-frame httpd light-traits list loader match-pattern memory message-manager namespace observer-service plain-text-console preferences-service promise querystring runtime sandbox tab-browser text-streams traceback traits unit-test unload url uuid window/utils window-utils xhr xpcom xul-app

API Utils provides a basic CommonJS infrastructure for developing traditional XULRunner add-ons and applications. It is the basis for the Add-on SDK.

To address issues present in traditional add-on development, API Utils provides mechanisms for:

  • writing and executing test cases, inspired by Python's nose package,
  • tracking JS objects of interest to aid in memory profiling and leak detection,
  • registering callbacks that perform cleanup tasks when modules are unloaded,
  • easily reporting errors with full stack tracebacks.

API Utils also has the following characteristics:

  • Beautiful, concise documentation.
  • A rigorous test suite ensuring that the library doesn't break as the Mozilla platform evolves.
  • Solid developer ergonomics ensuring that developers can easily find out why something they're doing isn't working.

API Utils is intended to be very small and only contain the bare minimum of functionality that all add-ons need.

Note that the API Utils package has not fully stabilized yet, meaning that we do still expect to make incompatible changes to its APIs in future releases of the SDK.