此代码在安装扩展后可以正常工作,但是当我重新启动浏览器时它会失败。调用启动函数有什么区别:
安装时
开始时
代码:
function startup(aData, aReason) {
_webSocket = new Services.appShell.hiddenDOMWindow.WebSocket("ws://localhost:8887/");
...
}
错误:[JavaScript 警告:“WARN addons.xpi:在 screen-capture@smail.com 上运行引导方法启动时出现异常:[异常...”组件返回失败代码:0x80004005(NS_ERROR_FAILURE)[nsIAppShellService.hiddenDOMWindow]“nsresult:” 0x80004005 (NS_ERROR_FAILURE)”位置:“JS 框架 :: resource://gre/modules/XPIProvider.jsm -> jar:file:///data/data/org.mozilla.firefox/files/mozilla/lmwz0qwc.default/ extensions/screen-capture@smail.com.xpi!/bootstrap.js :: SmartScreencap.connect_ws :: line 89" data: no]" {file: "resource://gre/modules/XPIProvider.jsm -> jar: file:///data/data/org.mozilla.firefox/files/mozilla/lmwz0qwc.default/extensions/screen-capture@smail.com.xpi!/bootstrap.js" 行:89}]