JavaScript code modules

  • Revision slug: JavaScript_code_modules
  • Revision title: JavaScript code modules
  • Revision id: 43827
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment 64 words added, 34 words removed

Revision Content

{{ fx_minversion_header("3") }}

JavaScript code modules let multiple privileged JavaScript scopes share code. For example, a module could be used by Firefox itself as well as by extensions, in order to avoid code duplication.

General topics

Using JavaScript code modules
An introduction to how to use JavaScript code modules.
Component.utils.import
How to import a JavaScript code module.

Standard code modules

ctypes.jsm {{ fx_minversion_inline("3.6") }}
Provides an interface that allows JavaScript code to call native libraries without requiring the development of an XPCOM component.
NetUtil.jsm
Provides helpful networking utility functions, including the ability to easily copy data from an input stream to an output stream asynchronously.
openLocationLastURL.jsm
Provides access to the last URL opened using the "Open Location" option in the File menu.
PluralForm.jsm
Provides an easy way to get the correct plural forms for the current locale, as well as ways to localize to a specific plural rule.
XPCOMUtils.jsm
Contains utilities for JavaScript components loaded by the JS component loader.

Revision Source

<p>{{ fx_minversion_header("3") }}</p>
<p>JavaScript code modules let multiple privileged JavaScript scopes share code. For example, a module could be used by Firefox itself as well as by extensions, in order to avoid code duplication.</p>
<table class="mainpage-table"> <tbody> <tr> <td width="50%"> <h2>General topics</h2> <dl> <dt><a class="internal" href="/en/JavaScript_code_modules/Using_JavaScript_code_modules" title="en/JavaScript code modules/Using JavaScript code modules">Using JavaScript code modules</a></dt> <dd>An introduction to how to use JavaScript code modules.</dd> <dt><a class="internal" href="/en/Components.utils.import" title="en/Components.utils.import">Component.utils.import</a></dt> <dd>How to import a JavaScript code module.</dd> </dl> </td> <td width="50%"> <h2>Standard code modules</h2> <dl> <dl> <dt><a href="/en/JavaScript_code_modules/ctypes.jsm" title="en/JavaScript code modules/ctypes.jsm">ctypes.jsm</a> {{ fx_minversion_inline("3.6") }}</dt> <dd>Provides an interface that allows JavaScript code to call native libraries without requiring the development of an XPCOM component.</dd> </dl> <dl> <dt><a class="internal" href="/en/JavaScript_code_modules/NetUtil.jsm" title="en/JavaScript code modules/NetUtil.jsm"><span style="font-weight: bold;">NetUtil.jsm</span></a></dt> <dd>Provides helpful networking utility functions, including the ability to easily copy data from an input stream to an output stream asynchronously.</dd> <dt><a class="internal" href="/en/JavaScript_code_modules/openLocationLastURL.jsm" title="en/JavaScript code modules/openLocationLastURL.jsm">openLocationLastURL.jsm</a></dt> <dd>Provides access to the last URL opened using the "Open Location" option in the File menu.</dd> <dt><a href="/en/Localization_and_Plurals" title="en/Localization and Plurals">PluralForm.jsm</a></dt> <dd>Provides an easy way to get the correct plural forms for the current locale, as well as ways to localize to a specific plural rule.</dd> <dt><a class="internal" href="/en/JavaScript_code_modules/XPCOMUtils.jsm" title="en/JavaScript code modules/XPCOMUtils.jsm">XPCOMUtils.jsm</a></dt> <dd>Contains utilities for JavaScript components loaded by the JS component loader.</dd> </dl> </dl></td> </tr> </tbody> </table> 
Revert to this revision