Mozilla 应用程序可以访问进程管理器吗?

发布于 2024-08-06 15:24:28 字数 310 浏览 7 评论 0原文

真的,我有 3 个问题,但它们都非常简单(一次):

  1. Firefox 中的附加组件是否可以查看是否有多个 Firefox 实例/Firefox 进程正在运行?

  2. 由于让 Firefox 的多个实例运行的唯一方法(至少在 Windows 中)是让它们在不同的配置文件下运行,因此附加组件是否可以确定其他实例在哪些配置文件下运行?< /p>

  3. 附加组件可以与其他进程交互吗?具体来说,它是否可以执行诸如关闭其他进程或告诉它使用附加组件进程中指定的 URL 打开新窗口之类的操作?

Really, I have 3 questions, but they are all pretty straightforward (for once):

  1. Can an add-on in Firefox see if there are multiple instances of Firefox/the Firefox process running?

  2. 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?

  3. 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

佼人 2024-08-13 15:24:28
  1. 间接:Firefox 不允许在同一配置文件上运行多个实例。由于您的插件是配置文件的一部分,因此“您的”Firefox(运行该插件的浏览器)是唯一的。

  2. 可能不是。个人资料信息与安全相关,而 Firefox 不会轻易泄露这些信息。这就是使用随机前缀创建配置文件名称的原因之一。

  3. Firefox 监听远程命令(这就是新进程告诉现有 FF 打开新 URL 的方式),因此可以打开更多窗口。我不知道是否有远程命令可以终止 FF。

注意:如果您开始关闭其他窗口并通过加载广告来惹恼人们,他们会讨厌您。只需几秒钟即可禁用和卸载不需要的插件。如果您尝试采取任何措施阻止用户卸载您的插件,他们会非常讨厌您。可能涉及干草叉或焦油和羽毛。 ;)

  1. 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.

  2. 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.

  3. 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. ;)

枉心 2024-08-13 15:24:28

附加组件(或“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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文