Sha256: 354236398ca2cec91729628e87fd02c615d76d26b0fd2f62c09d31f242efaa43

Contents?: true

Size: 1.5 KB

Versions: 3

Compression:

Stored size: 1.5 KB

Contents

Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");

// Singleton time
var XPCOMCoreBootstrapper = function() {
  if (arguments.callee.__singletonInstance__) { return arguments.callee.__singletonInstance__; };
  arguments.callee.__singletonInstance__ = this;
};

XPCOMCoreBootstrapper.prototype = {
  bootstrapped: false,
  classDescription: "XPCOMCore Bootstrapper Component",
  contractID: "@conflagrationjs.org/xpcomcore/bootstrapper;1",
  classID: Components.ID("{5412c380-b3b2-11de-8a39-0800200c9a66}"),
  QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIObserver]),
  _xpcom_categories: [{category: "xpcom-startup"}],
  
  observe: function(subject, topic, data) {
    if (topic != "xpcom-startup") { return false; }
    if (this.bootstrapped) {
      dump("\n\nXPCOMCore already bootstrapped.\n\n");
    } else {
      var env = Components.classes["@mozilla.org/process/environment;1"].getService(Components.interfaces.nsIEnvironment);
      var xpcomcoreBootstrapper = env.exists('XPCOMCORE_BOOTSTRAP') && env.get('XPCOMCORE_BOOTSTRAP');
      if (xpcomcoreBootstrapper) { 
        dump("\n\nLoading XPCOMCore Bootstrapper from " + xpcomcoreBootstrapper + ".\n\n");
        Components.utils.import("file://" + xpcomcoreBootstrapper);
        dump("\n\nXPCOMCore bootstrapped.\n\n");
      } else {
        dump("\n\nNot loading XPCOMCore Bootstrapper.\n\n");
      }      
    }
  }
  
};

NSGetModule = function(compMgr, fileSpec) { return XPCOMUtils.generateModule([XPCOMCoreBootstrapper]); };

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
xpcomcore-rubygem-0.3.2 extension/components/bootstrapper.js
xpcomcore-rubygem-0.3.1 extension/components/bootstrapper.js
xpcomcore-rubygem-0.3.0 extension/components/bootstrapper.js