Firefox扩展开发firefox4

Jes*_*mos 5 firefox xpcom firefox-addon

所以我一直在努力更新用于FF4和Gecko 2的旧扩展,但是我遇到了一些问题,我收到的错误是,classID缺失或组件不正确....

有没有其他人有类似的问题或知道如何解决这个问题?

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;
Run Code Online (Sandbox Code Playgroud)

在原型上为此调用generateNSGetFactory时,它在FF4中的错误控制台中发出错误,抱怨classID.我很确定没有其他东西使用相同的GUID,所以我没有看到问题.

eri*_*old 2

Fx4 中 JS XPCOM 组件的一个重要更改是它们现在需要在 chrome.manifest 中注册,请参阅本页文档了解更改。