因此,我一直在努力更新旧的扩展程序,以用于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;
为此,在原型(prototype)上调用generateNSGetFactory时,它会在FF4的错误控制台中显示错误,提示classID。我很确定其他任何东西都没有使用相同的GUID,所以我看不到问题所在。
最佳答案
Fx4中JS XPCOM组件的一个重要变化是它们现在需要在chrome.manifest中注册,请参阅documentation on the changes的此页面。
关于Firefox扩展开发firefox4,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/3997134/