我正在尝试使我的插件支持便携式Firefox,我可以正常工作,但是我想从同一插件支持便携式和非便携式。我不想为便携式用户单独发布。
因此,我正在尝试从插件中检测运行它的Firefox是否可移植。事实证明,这非常棘手。
这些是其他人们想要帮助的地方:
我将获得XREExeF
路径,向后走一个目录并检查目录AppInfo
和DefaultData
是否存在。
Firefox
目录也存在,但对于Aurora和Nightly便携式计算机,其名称可能有所不同。
var exeFile = FileUtils.getFile("XREExeF", []);
var defaultdata = exeFile.parent.parent;
var appinfo = defaultdata.clone();
defaultdata.append("DefaultData");
appinfo.append("AppInfo");
if(defaultdata.exists() && appinfo.exists() && defaultdata.isDirectory && appinfo.isDirectory())
console.log("This is Portable Firefox");
else
console.log("This is not Portable Firefox");