Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
XPCOM "Core" library emulating many of the features available in the standard Ruby one.
JavaScript Shell
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
components
doc
lib
test
.gitignore
LICENSE
README
Rakefile
bootstrapper.js
build_properties.yml

README

XPCOMCore
=========

A standard library like Ruby's, only for JavaScript (with XPCOM access).

Installation
============

Check out / submodule in / whatever the code to a place of your choosing. Then load it from an XPCOM component like so:

    Components.utils.import("resource://app/chrome/content/vendor/xpcomcore/bootstrapper.js");

Then, to pull XPCOMCore into your scope, do this lovely little trick:
    
    XPCOMCore({scope: this});
    
If you wish to not automatically mix in the `Kernel` module, pass another argument like so:

    XPCOMCore({scope: this, importKernel: false});
    
Then, whenever you want to make use of XPCOMCore (say, from a XUL window), do the same deal. For example:

    <script type="text/javascript">XPCOMCore({scope: this});</script>
    
Then you'll have access to methods such as load() and require() and whatever else is defined in Kernel.

- Gabriel Gironda
Something went wrong with that request. Please try again.