Mozilla 应用程序可以访问进程管理器吗?
真的,我有 3 个问题,但它们都非常简单(一次):
Firefox 中的附加组件是否可以查看是否有多个 Firefox 实例/Firefox 进程正在运行?
由于让 Firefox 的多个实例运行的唯一方法(至少在 Windows 中)是让它们在不同的配置文件下运行,因此附加组件是否可以确定其他实例在哪些配置文件下运行?< /p>
附加组件可以与其他进程交互吗?具体来说,它是否可以执行诸如关闭其他进程或告诉它使用附加组件进程中指定的 URL 打开新窗口之类的操作?
Really, I have 3 questions, but they are all pretty straightforward (for once):
Can an add-on in Firefox see if there are multiple instances of Firefox/the Firefox process running?
Since the only way (in Windows, at least) to have multiple instances of Firefox running is by having them run under different profiles, is it possible for an add-on to determine which profiles the other instances are running under?
Could an add-on interact with the other process? Specifically, could it do things like close the other process or tell it to open a new window with a URL specified within the add-on's process?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
间接:Firefox 不允许在同一配置文件上运行多个实例。由于您的插件是配置文件的一部分,因此“您的”Firefox(运行该插件的浏览器)是唯一的。
可能不是。个人资料信息与安全相关,而 Firefox 不会轻易泄露这些信息。这就是使用随机前缀创建配置文件名称的原因之一。
Firefox 监听远程命令(这就是新进程告诉现有 FF 打开新 URL 的方式),因此可以打开更多窗口。我不知道是否有远程命令可以终止 FF。
注意:如果您开始关闭其他窗口并通过加载广告来惹恼人们,他们会讨厌您。只需几秒钟即可禁用和卸载不需要的插件。如果您尝试采取任何措施阻止用户卸载您的插件,他们会非常讨厌您。可能涉及干草叉或焦油和羽毛。 ;)
Indirectly: Firefox doesn't allow to have multiple instances running on the same profile. Since your plugin is part of a profile, "your" Firefox (the one running the plugin) is unique.
Probably not. Profile information is security related and Firefox doesn't hand that out easily. That's one reason why the profile names are created with random prefixes.
Firefox listens to remote commands (that's how a new process tells an existing FF to open a new URL), so opening more windows is possible. I don't know whether there is a remote command to terminate FF.
Note: If you start closing other windows and annoy people by loading ads, they will hate you. It takes only a few seconds to disable and uninstall an unwanted plugin. And if you try anything to prevent users from uninstalling your plugin, they will really hate you. Pitchforks or tar and feathers might be involved. ;)
附加组件(或“Mozilla 应用程序”)可以执行任何操作,因为它可以包含二进制组件。如果您要求 JS 提供可用的现有 API,我认为现在还没有。
如果您愿意将附加组件安装到所有配置文件中,则实例 #1 中的附加组件可以使用任何 IPC 机制(例如套接字)与实例 #2 中的附加组件进行通信(只能从 JS 中使用)添加在)。
An add-on (or a "Mozilla app") can do anything, since it can include binary components. If you're asking for existing APIs usable from JS, I don't think there are any right now.
If you're open to installing an add-on into all profiles, your add-on in instance #1 could communicate with your add-on in instance #2 using any IPC mechanism, such as sockets (which are usable from JS-only add-on).