简体   繁体   English

从外部应用程序调用Firefox XPCOM?

[英]Calling Firefox XPCOM from external app?

Context: we need to read Firefox cookies in our app; 上下文:我们需要在应用程序中阅读Firefox cookie; until Firefox 3.5, this was possible by reading cookies.txt / cookies.sqlite. 在Firefox 3.5之前,可以通过读取cookies.txt / cookies.sqlite来实现。 In Firefox 3.5, it exclusively locks the cookie file so outside apps can't read it (see https://bugzilla.mozilla.org/show_bug.cgi?id=476167 ), and even if we make a local copy, FF doesn't always flush the cookies to disk until exit so they may not be there. 在Firefox 3.5中,它以独占方式锁定cookie文件,因此外部应用程序无法读取它(请参阅https://bugzilla.mozilla.org/show_bug.cgi?id=476167 ),即使我们进行本地复制,FF也不会在退出前,请不要总是将cookie刷新到磁盘上,以免它们在那里。

The suggested solution is to use nsICookieManager, which looks like what we need -- but how can I get at one of those from a process that isn't Firefox? 建议的解决方案是使用nsICookieManager,它看起来像我们所需要的-但如何从不是Firefox的进程中获得其中之一?

Everything I see about XPCOM suggests I can only use it from firefox extensions -- do we have to write an extension, and then somehow invoke Firefox to install our extension and then somehow invoke the extension itself to pass cookies back out? 我所看到的有关XPCOM的一切都表明我只能在firefox扩展中使用它-我们是否必须编写一个扩展,然后以某种方式调用Firefox来安装我们的扩展,然后以某种方式调用该扩展本身以将cookie传回?

Yes - you'll have to build an extension which communicates from your application to Firefox. 是的-您必须构建一个扩展程序,以将您的应用程序与Firefox进行通信。 You can install the add-on with the windows registry (assuming you are on windows). 您可以使用Windows注册表安装附加组件(假设您在Windows上)。

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

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