question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

Description

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

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

This cannot be fixed easily. The native part of the project currently launches Firefox with the --class argument, which should set the WM_CLASS property of the window to the PWA ID. However, because all Firefox processes in the same profile are connected together, all windows have WM_CLASS of the first PWA. Fixing this would probably require modifying Firefox C++ code. Check this comment and related discussions for ideas and possible solutions to fix this.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:6
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Coeur-Noircommented, Jun 20, 2022

Hi,

This is how it works for me « manually » ie. not « true » PWA.

firefox_many_icons_and_profiles Regular Firefox has its legacy launcher :

firefox.desktop

[Desktop Entry]
Version=1.0
Name=Firefox Web Browser
Name[fr]=Navigateur Web Firefox
Comment=Browse the World Wide Web
Comment[fr]=Naviguer sur le Web
GenericName=Web Browser
GenericName[fr]=Navigateur Web
Keywords=Internet;WWW;Browser;Web;Explorer
Keywords[fr]=Internet;WWW;Browser;Web;Explorer;Fureteur;Surfer;Navigateur
Exec=firefox %u
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=firefox
Categories=GNOME;GTK;Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;x-scheme-handler/chrome;video/webm;application/x-xpinstall;
StartupNotify=true
Actions=new-window;new-private-window;

[Desktop Action new-window]
Name=Open a New Window
Name[fr]=Ouvrir une nouvelle fenêtre
Exec=firefox -new-window

[Desktop Action new-private-window]
Name=Open a New Private Window
Name[fr]=Ouvrir une nouvelle fenêtre de navigation privée
Exec=firefox -private-window

Deezer has its own :

deezer.desktop

[Desktop Entry]
Version=1.1
Type=Application
Name=Deezer
Comment=Deezer via Firefox
Icon=deezer
Exec=firefox --new-window -P Deezer https://www.deezer.com/fr/ --class Deezer %u
Actions=
Categories=AudioVideo;Audio;Player;Network;
StartupWMClass=Deezer
StartupNotify=true

and Google Drive another one :

google-drive.desktop

[Desktop Entry]
Version=1.1
Type=Application
Name=Google Drive
Comment=Google Drive via Firefox
Icon=google-drive
Exec=firefox --new-window -P Gdrive https://drive.google.com/drive/my-drive --class Gdrive %u
Actions=
Categories=Network;
StartupWMClass=Gdrive
StartupNotify=true

Firefox profile contains :

django@ASGARD:~$ ls -la .mozilla/firefox/
total 44
drwx------  9 django django 4096 juin  20 22:21  .
drwx------  5 django django 4096 juin  10 03:30  ..
drwx------  3 django django 4096 juin   9 17:04 'Crash Reports'
drwxrwx--- 13 django django 4096 juin  20 22:20  dj4ng0.Deezer
drwxrwx--- 10 django django 4096 juin  20 22:12  dj4ng0.Gdrive
drwx------ 10 django django 4096 juin   1 19:37  e31kfxht.default-release
drwx------  2 django django 4096 juin  20 22:21  firefox-mpris
drwx------ 14 django django 4096 juin  20 22:21  g3r47d.default
-rw-rw-r--  1 django django  125 juin   1 19:42  installs.ini
drwx------  2 django django 4096 juin   1 19:35 'Pending Pings'
-rw-rw-r--  1 django django  417 juin  20 21:38  profiles.ini
django@ASGARD:~$ 

and profiles.ini contains :

[Profile3]
Name=Gdrive
IsRelative=1
Path=dj4ng0.Gdrive          # part after the dot same as name

[Profile2]
Name=Deezer
IsRelative=1
Path=dj4ng0.Deezer

[Profile1]
Name=default
IsRelative=1
Path=g3r47d.default

[Profile0]
Name=default-release
IsRelative=1
Path=e31kfxht.default-release

[InstallFF3DB405C1B59D61]
Default=e31kfxht.default-release
Locked=1

[General]
StartWithLastProfile=1
Version=2

[Install6AFDA46A1A8AD48]
Default=g3r47d.default
Locked=1

In launchers, mind the Exec and StartupWMClass entries :

  • –new-window
  • -P
  • –class
  • %u ( not sure if it’s mandatory )

In profiles.ini, mind the naming of each Firefox profile, the same wording for each matters.

If placed into ~/.local/share/applications the desktop files make those websites appear in the « app menu » as « regular » app’s.

All these give me for years visually « separate » instances of Firefox for some websites I prefer to keep aside the main Firefox.

Ubuntu here, can’t say about Windows nor Mac, sorry.

1reaction
alchzhcommented, Dec 1, 2021

xprop can externally set the WM_CLASS of the window after it was created w/o modifying the Firefox binary itself. idk what this will do if you have wayland though.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Building multiple Progressive Web Apps on the same domain
Explore the recommended and not recommended ways of building multiple PWAs reusing the same domain with their pros and cons.
Read more >
Outlook PWAs for Different Office 365 Accounts - Thurrott.com
I'm just wondering if there is any way to create multiple PWAs for Outlook as if I sign into one account and create...
Read more >
Progressive web apps (PWAs) - MDN Web Docs - Mozilla
Progressive Web Apps (PWAs) are web apps that use service workers, manifests, and other web-platform features in combination with progressive ...
Read more >
2022 October 24 | Techrights
What's the open-source story, and is Linux being left out? ... All the programs share the same basic command-line user interface (modeled on...
Read more >
UDN Search - UDN Web Docs: MDN Backup
this candidate is the source of one of the two rtcicecandidatestats objects ... the video first of all the <video> element is defined,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found