mozilla

Revision 43824 of JavaScript code modules

  • Revision slug: JavaScript_code_modules
  • Revision title: JavaScript code modules
  • Revision id: 43824
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment 23 words added

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

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.
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> <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 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></td> </tr> </tbody>
</table>
Revert to this revision