我已阅读此线程和其他一些 如何在我的 Firefox 扩展中运行本地 exe
问题是,在部署和使用 firefox 4.0.1 时,如果我安装 .xpi 扩展名,xpi 将作为 ****.xpi 放在 \Profiles...\extensions 中,这是一种压缩格式
所有解决方案都假定扩展名放在文件夹中,因此他们按原样访问文件夹,我不能这样做
例如这个人说
//**** get profile folder path ****
var dsprops = Components.classes['@mozilla.org/file/directory_service;1']
.getService(Components.interfaces.nsIProperties);
var ProfilePath = dsprops.get("ProfD", Components.interfaces.nsIFile).path;
//**** initialize file ****
var file = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
file.initWithPath(ProfilePath);
//**** append each step in the path ****
file.append("extensions");
file.append("guid");
file.append("sample.exe");
在我的情况下,guid 安装为 {f13b157f-b174-47e7-a34d-4815ddffeb8}.xpi 无法通过这种方式访问