874
edits
Changes
→XULRunner extension, in a JS module: culled unnecessary comments
<pre class="brush:js;">
var SecurableModule = {};
Components.utils.import("resource://some_extension/content/booster.js",
SecurableModule);
var loader = SecurableModule.Loader({
defaultPrincipal: "system",
});
loader.require('blarg').doSomething();
</pre>
Note that unlike the previous example, we can't provide a relative directory name for <tt>rootPath</tt> because JS modules don't conventionally have a concept of relative directories (and we won't introduce such a concept here to reduce potential confusion). Note also that while we could unload the module if we want, we don't really
have any pressing reason to, since JS modules themselves are never
unloaded.