firefoxfirefox-addonxulprocess-monitoring

Do Mozilla apps have access to the process manager?


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?


Solution

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