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

PWAs close first time opening PWA - relative URL without a base #572

Open
spoorun opened this issue Oct 2, 2024 · 14 comments
Open

PWAs close first time opening PWA - relative URL without a base #572

spoorun opened this issue Oct 2, 2024 · 14 comments
Labels
bug Something isn't working could not reproduce This issue could not be reproduced help wanted Extra attention is needed

Comments

@spoorun
Copy link

spoorun commented Oct 2, 2024

Description

During any given session, I open a PWA and it momentarily opens than closes
If I open it a second time (from the menu or app icon but not the command line) it opens correctly
This happens whether the PWA is opened from the command line, the KDE menu, or clicking an icon

When opened from the command line, the following error is given:

/usr/bin/firefoxpwa site launch 01J96HRTE3XC6AW2AQBEFMI7MNMP --protocol %u
error: invalid value '%u' for '--protocol [<PROTOCOL>]': relative URL without a base For more information, try '--help'.

If I remove "%u" from the .desktop file the issue does not occur and the PWA opens correctly first time

Steps to Reproduce

  1. Create a PWA
  2. Restart the system (the error only occurs after a restart not when the PWA has just been installed)
  3. Launch the PWA from the menu or icon
    [It flashes up briefly then fails]
  4. Launch again
    [It launches correctly]

OR

  1. Create a PWA
  2. Restart the system (the error only occurs after a restart not when the PWA has just been installed)
  3. Launch the PWA from the command line
    [error is shown:[ (error: invalid value '%u' for '--protocol []': relative URL without a base) ]

Workaround

Remove "%U" from the .desktop file for the PWA
The app starts correctly from menu, icon or commandline

Affected Websites

All

Environment

First occurred at least 6 months ago

  • Operating system: Manjaro Linux
  • System architecture: 64
  • Desktop environment: KDE 6.0 - 6.1
  • Installation method: AUR
  • PWAsForFirefox extension version: 2.11 - 2.12.4
  • PWAsForFirefox native version: 2.11 - 2.12.5
  • PWAsForFirefox runtime version: 130.0.1 and earlier
  • Firefox version: 129 - 131
@spoorun spoorun added the bug Something isn't working label Oct 2, 2024
@filips123
Copy link
Owner

That may be a KDE bug. %u should be replaced with the URL when launching as a protocol handler, or be empty when launching normally. But I've tried to reproduce it on Manjaro with KDE in a VM and it works fine for me...

@filips123 filips123 added the could not reproduce This issue could not be reproduced label Oct 14, 2024
@wroyca
Copy link

wroyca commented Nov 13, 2024

I can confirm that this also happens with GNOME on Fedora 41.

@HappyHippo77
Copy link

HappyHippo77 commented Dec 26, 2024

Happens to me with GNOME on Fedora 41 and on Arch Linux. Seems to be a Linux issue? It's worth noting that occasionally it will work correctly.

@filips123
Copy link
Owner

Unfortunately, I still can't reproduce it neither on GNOME nor KDE. You can try to launch the desktop entry with gtk-launch FFPWA-ID.desktop and see if there are any errors.

@realDayaa
Copy link

Launching with gtk-launch FFPWA-ID.desktop opens the app without errors.

@probablyanewt
Copy link

I too have this issue. Manjaro and GNOME. Removing %u from the .desktop doesn't resolve it for me though.

@filips123
Copy link
Owner

I guess this might be another session-related problem, but I don't konow why it happens and how to fix it.

@filips123 filips123 added the help wanted Extra attention is needed label Dec 29, 2024
@probablyanewt
Copy link

@filips123 is there a verbose or debug mode I can run it with? I can see if I can get some more info.

@filips123
Copy link
Owner

You can try to get both the native and runtime logs.

@probablyanewt
Copy link

So in more recent updates, the crash occurs less often than it did previously, which makes it harder to poke.

I added the empty DEBUG file in ~/.local/share/firefoxpwa, and so far found the following:

  • Running firefoxpwa site launch <id> didn't write anything in the native log files logs.
  • I couldn't get the PWAs to crash when launching with the -- --jsconsole flag. I have a couple of dumps from the jsconsole, but I'm not sure how useful they are.
  • I did managed to capture an error in the terminal, following a crash, not sure if this is related to the cause, or simply occured because the app crashed however:
###!!! [Parent][DispatchAsyncMessage] Error: PBackgroundIDBFactory::Msg_PBackgroundIDBFactoryRequestConstructor Value error: message was deserialized, but contained an illegal value
  • The crashes seem to occur more often when launching from a .desktop in the gnome menu, compared to using the CLI. This is just a gut feeling at the moment though, and may be due to chance.

I'll have another poke tomorrow. I'll see if I can get it to crash again with the -- --jsconsole flag, and may also try building directly from source to see if that makes any difference.

@filips123
Copy link
Owner

Please update the native program to v2.13.2, run "patch profiles and runtime" from the extension settings and check if this issue happens again. I've fixed some other issue, but it might also be related to this one.

Note that the extension will say that it's outdated, but this is fine until the new version is also reviewed by Mozilla.

@probablyanewt
Copy link

I'm on v2.13.2, and ran the patch profiles and runtime from the extension, restarted my pc, but it still crashed first time.

@nemonein
Copy link

nemonein commented Dec 31, 2024

This also happens for Google Apps. (Keep, Calendar, etc)
I'm on Archlinux with KDE. firefoxpwa 2.13.2, Progressive Web Apps for Firefox is still 2.13.1.

I've found a workaroud(?) for this.
On FirefoxPWA settings, these must be ON.

  • Open previous windows and tabs
  • Show browser tabs and enable using multi-tabbed web apps

But there's one condition.
You have to close FF by Ctrl+W, not Alt-F4. (With mouse click, just click the tab's X button, not the Window's X.)
If you do it with Alt-F4, you will see duplicated tabs.

@mlncn
Copy link

mlncn commented Jan 1, 2025

This is happening with me for Harvest (https://example-businessname.harvestapp.com/) but not my other 'apps' (Big Blue Button rooms through https://meet.coop mostly). Can confirm that nemonein's workaround works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working could not reproduce This issue could not be reproduced help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

8 participants