Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firefox extension development firefox4

So I've been working on updating old extensions for use with FF4 and Gecko 2 but I am having some issues where I am getting an error that says, classID missing or incorrect for component....

Has anyone else had a similar issue or know of how to get around this?

function jsshellClient() {
  this.classDescription = "sdConnector JavaScript Shell Service";
  this.classID = Components.ID("{54f7f162-35d9-524d-9021-965a3ba86366}");
  this.contractID = "@activestate.com/SDService?type=jsshell;1"
  this._xpcom_categories = [{category: "sd-service", entry: "jsshell"}];
  this.name = "jsshell";
  this.prefs = Components.classes["@mozilla.org/preferences-service;1"]
      .getService(Components.interfaces.nsIPrefService)
      .getBranch("sdconnector.jsshell.");
  this.enabled = this.prefs.getBoolPref("enabled");
  this.port = this.prefs.getIntPref("port");
  this.loopbackOnly = this.prefs.getBoolPref("loopbackOnly");
  this.backlog = this.prefs.getIntPref("backlog");
}
jsshellClient.prototype = new session();
jsshellClient.prototype.constructor = jsshellClient;

When calling generateNSGetFactory on the prototype for this it gives an error in the Error Console in FF4 complaining about the classID. I'm pretty sure that nothing else is using the same GUID so I don't see the problem.

like image 591
Jesus Ramos Avatar asked Nov 06 '22 07:11

Jesus Ramos


1 Answers

An important change in JS XPCOM components in Fx4 is that they now need to be registered in the chrome.manifest, see this page of documentation on the changes.

like image 190
erikvold Avatar answered Nov 15 '22 11:11

erikvold