Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All PWAs in the same profile are merged with the first PWA that was opened (macOS-only) #81

Open
filips123 opened this issue Nov 9, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@filips123
Copy link
Owner

Description

All PWAs are merged with the first PWA that was opened. This only applies to macOS.

When some PWA is already running, all newly launched PWAs will merge with it and remain merged until all of them are closed. This will cause the app menu to display all PWAs as part of the first PWA that was launched, with its icon and desktop actions (if any).

Users can prevent this by installing each PWA into a different profile.

Steps to Reproduce

  1. Install at least two different PWAs into the same profile.
  2. Launch the first PWA.
  3. See that it has the correct icon.
  4. Launch another PWA without closing the first one.
  5. See that is merged with the first one and has the wrong icon.

Possible Solution

Apple only allows a process to be associated with a single application at all times. Perhaps this could be solved by using an IPC link between a host process and the main Firefox runtime process, the same way the Firefox parent process handles its content processes. This is just a wild theory though and has to be investigated further. See this comment for more.

@filips123 filips123 added the bug Something isn't working label Nov 9, 2021
filips123 added a commit that referenced this issue Jul 31, 2022
Still not complete because it does not work when multiple web apps are used in the same profile. This does not matter currently as multiple web apps per profile should not be used because of #81, but once it is fixed, this also needs to be reworked.
@dmose
Copy link

dmose commented Nov 7, 2022

From the comment linked to in the issue description:

Maybe. Gecko uses IPC links internally to render websites in its content processes, but display them in the window of the parent process. Here is a brief explanation from back in 2013 when it was first implemented. I think we might also be able to use the same IPC protocol between our host process and the main Firefox runtime, but there is not much public documentation on how exactly this works. I think we would have to find a gecko engineer who can tell us if a gecko is ready for such a setup or how much work it would be to make it possible.

Since that comment was written by @TitanNano, I believe the IPC documentation has gotten substantially better. If that doesn't have what you need, reach out to me on chat.mozilla.org (I'm dmosedale@mozilla.com there), and I can perhaps find a gecko engineer who knows more...

@julian-klode
Copy link

I also see this on GNOME on Ubuntu on Wayland, I moved two apps into the default profile and then the app I open second is grouped with the app I open first.

@filips123
Copy link
Owner Author

@julian-klode I reopened and created a comment in #80 because that is the issue for this problem on Linux.


@dmose Sorry for quite the late reply and thanks for that. I don't know much about macOS development and Gecko internals (and neither have a good setup for testing that, except quite a slow VM), so I'm afraid I won't be able to do this. However, if anyone else can try to implement this, I will try to help where I can.

One other possible problem is that I won't want to fork Firefox, as maintaining the infrastructure to build and ship all updates to users would be too hard, and it would also make it harder to use alternative Firefox-based browsers. So, if possible, the required changes to Firefox should be upstreamed, or the IPC should be somehow called from this project's own code (maybe from the Rust part or UserChromeJS).

Another relevant issue is #42. I created a workaround that only works with separate profiles, so when/if this issue is fixed, a fix for that one should also be reworked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: On Hold
Development

No branches or pull requests

3 participants