每当我按下打开IE 图标时,我在控制台中出现错误: 错误:NS_ERROR_FILE_NOT_FOUND:组件返回失败代码:0x80520012(NS_ERROR_FILE_NOT_FOUND)[nsIProcess.init] 源文件:chrome://openinie/content/openinie.js 行:126(自从升级到16.0后发生这种情况,我认为它可能与安全相关)
我发现js文件是里面一些“openinie@wittersworld.com.xpi”文件(我巧妙地将其重命名为zip),并看到了违规行:
var iePath = openinie.getIEPath();
// create an nsILocalFile for the executable
var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
file.initWithPath(iePath);
// create an nsIProcess
var process = Components.classes["@mozilla.org/process/util;1"].createInstance(Components.interfaces.nsIProcess);
process.init(file); // <-line 126
var iePath = openinie.getIEPath();
// create an nsILocalFile for the executable
var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
file.initWithPath(iePath);
// create an nsIProcess
var process = Components.classes["@mozilla.org/process/util;1"].createInstance(Components.interfaces.nsIProcess);
process.init(file); // <-line 126
答案 0 :(得分:1)
是否可以修复它并“重新编译”它压缩和重命名
是的,您可以简单地替换ZIP存档中的文件,大多数扩展都没有签名(如果是这样,您可以从XPI文件中删除META-INF
目录)。实际上,对于您的调试,最好将openinie@wittersworld.com.xpi
解压缩到同一文件夹中名为openinie@wittersworld.com
的目录中并删除原始文件 - 这样您就不需要在每次更改时打包/解压缩。您还应该使用-purgecaches
命令行参数启动Firefox,否则您正在更改的文件可能会被缓存。
我可以使用例如警告框来调试它来显示变量值吗?
是。但是,我宁愿建议Components.utils.reportError()
method登录到错误控制台(按Ctrl-Shift-J打开它),而不打开模态对话框。在这个特殊情况下,我会写:
Components.utils.reportError(iePath);
这似乎指向一个不存在的文件,意味着getIEPath()
函数有问题。