-
-
Notifications
You must be signed in to change notification settings - Fork 57
Option to focus an existing instance of a web app #291
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
Comments
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 #!/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. |
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 #287
Originally posted by ThijmenDam February 6, 2023
Hi! I wonder if the current opening behavior of an app on macOS is intended. Right now, if I open a PWA that is already running (i.e. by double clicking the app icon or through Spotlight), a second instance of the app is opened. However, to me it would make more sense if the instance of the app that's already running would be brought to the front instead of opening a new instance. I think this is more in line with the usual behavior of macOS apps.
The text was updated successfully, but these errors were encountered: