Closed filips123 closed 1 year ago
Hello. I'm in Linux and I have exactly this problem. When the app is open and I double click the app launcher a second time, a second window opens.
This is my environment:
➜ ~
➜ ~ firefoxpwa --version
firefoxpwa 2.12.5
➜ ~ firefox --version
Mozilla Firefox 131.0.3
➜ ~ uname -a && lsb_release -a 2>/dev/null | grep 'Description'
Linux lat7310 6.11.5-1-default #1 SMP PREEMPT_DYNAMIC Wed Oct 23 04:27:11 UTC 2024 (b4e3aa9) x86_64 x86_64 x86_64 GNU/Linux
Description: openSUSE Tumbleweed
As a workaround, install wmctrl
, saved the following script as /usr/bin/firefoxwpa-single
, give it permission to be executed and replace all the web app launchers in ~/.local/share/applications
to point to /usr/bin/firefoxwpa-single
instead of /usr/bin/firefoxwpa
. A bit awful as a solution, but it does the job.
#!/usr/bin/python
import sys, subprocess
cmd = ["firefoxpwa"] + sys.argv[1:]
if sys.argv[1:3] == ["site", "launch"] and len(sys.argv) >= 4:
code = sys.argv[3]
# Check if there is an open window with the app code
stdout = subprocess.check_output(["wmctrl", "-lx"]).decode("utf-8")
for line in stdout.split("\n"):
if code in line:
cmd = ["wmctrl", "-x", "-a", code]
break
subprocess.run(cmd)
You can enable focusing the existing window in the app browser settings.
You can enable focusing the existing window in the app browser settings.
Oh, yes. I was searching everywhere in the settings of the extension, not in the browser settings inside the PWA.
Thank you, I just realized that this is also mentioned by you here.
Discussed in https://github.com/filips123/PWAsForFirefox/discussions/287