/components/test_xpcom.js
function NSGetModule() {
return {
registerSelf : function (compMgr, fileSpec, location, type) {
compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar).registerFactoryLocation(
Components.ID("your-xpcom-guid-xxx-xxx"),
"your_xpcom_name",
"@your.org/contract/id;1",
fileSpec,
location,
type
)
},
getClassObject : function () {
return {
createInstance : function() {
var instance = { obj:{ name : "test_instance" } }
instance.wrappedJSObject = instance
return instance
}
}
},
canUnload : function () {
return true;
}
}
}