Labs/JS Modules: Difference between revisions

Jump to navigation Jump to search
put the usage info into its own section
(try a flatter structure)
(put the usage info into its own section)
Line 1: Line 1:
Back to [[Labs]].
Back to [[Labs]].


Here you'll find a collection of modules which you can import into your extension.  The goal is to make extension development easier by implementing common functionality as reusable libraries.
Here you'll find a collection of modules which you can import into your extension.  The goal is to make extension development easier by implementing common functionality as reusable libraries. If you would like to contribute a new module, get in touch with us at #labs!
 
= Usage =


The modules here are designed to be imported with Components.utils.import().  To avoid namespace collisions with core code and other extensions, use the two-parameter form of import() to import the module's symbols into a namespace defined by your extension, i.e.:
The modules here are designed to be imported with Components.utils.import().  To avoid namespace collisions with core code and other extensions, use the two-parameter form of import() to import the module's symbols into a namespace defined by your extension, i.e.:
Line 7: Line 9:
  let MyExtension = {};
  let MyExtension = {};
  Components.utils.import("resource://myextension/modules/SomeModule.js", MyExtension);
  Components.utils.import("resource://myextension/modules/SomeModule.js", MyExtension);
If you would like to contribute a new module, get in touch with us at #labs!


= Logging =
= Logging =
canmove, Confirmed users
2,056

edits

Navigation menu