mozilla 扩展 - 读取外部进程的标准输出
我正在尝试使用 Components.interfaces.nsIProcess 从 Thunderbird 扩展运行 dvipng 进程。我需要读取该过程的标准输出,但我无法找到一种方法来做到这一点。我在 nsIProcess2 上发现了一些线程,但那个线程(看起来)从未完全用 stdout 实现。有什么建议吗?
I am trying to run dvipng
process from a thunderbird extension using Components.interfaces.nsIProcess
. I need to read standard output of the process, but I am not able to find a way to do that. I found some threads on nsIProcess2
, but that one was (as it seems) never fully implemented with stdout. Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
nsIProcess2
不相关 - 它是 已实现,但后来合并到 nsIProcess 中。它只是关于异步启动进程。相关错误是 bug 484246 和 错误 68702。后者已经解决,但到目前为止,默认情况下,代码并未随 Firefox/Thunderbird 一起提供(Firefox 和 Thunderbird 都不需要自己的大量代码)。所以你的选择是:
dvipng
的本机库,通过 js- 使用它ctypes - 应该是最简单的解决方案。nsIProcess2
is unrelated - it was implemented but later folded intonsIProcess
. It was only about starting processes asynchronously.The relevant bugs are bug 484246 and bug 68702. The latter has been resolved but so far that code doesn't ship with Firefox/Thunderbird by default (it's quite a bit of code that neither Firefox nor Thunderbird need themselves). So your options are:
dvipng
for you, use it via js-ctypes - should be the easiest solution.dvipng
into a library and use it directly via js-ctypes - probably not too hard either, this will also give you better performance.