简体   繁体   English

如何从XPCOM(Firefox)的外部程序获取返回字符串?

[英]How do I get return string from external program in XPCOM (Firefox)?

I want to run an external program in XPCOM but I need to get the actual return string from the program, not just a return code. 我想在XPCOM中运行外部程序,但我需要从程序中获取实际的返回字符串,而不仅仅是返回代码。 How would I do this? 我该怎么做?

All I've found is nsICommandLine, nsICommandLineHandler, nsICommandLineRunner and nsIProcess none of which return anything beyond an exit code (from what I can see). 我发现的只是nsICommandLine,nsICommandLineHandler,nsICommandLineRunner和nsIProcess,它们都没有返回任何超出退出代码的内容(据我所见)。

Gecko doesn't have any meaningful IPC capabilities. Gecko没有任何有意义的IPC功能。 While the process is running you can communicate with it via TCP sockets. 在进程运行时,您可以通过TCP套接字与之通信。 If you want to return something when the process finishes - write to a file and your Firefox extension can read out that file then. 如果您想在处理完成后返回某些内容,请写入文件,然后Firefox扩展程序可以读取该文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM