Chrome PWA Issue

I tried searching online for help with this but not luck, so I'll just try to ask here.
It's a really bizarre issue.

So, I have Google Chrome installed.

I use PWAs, you know the web pages that are treated like their own apps, they open in their own window and have a shortcut alongside the rest of my apps.

The Youtube PWA, for some reason, just keeps uninstalling itself. Or rather the shortcut in the all apps view just disappears and it doesn't show up as installed anymore.
Oddly, Google Chrome does show it's installed, going into chrome://apps/ and I can bring the shortcut back through there. Or just reinstall it.

But whenever it happens, the shortcut disappears from the all apps view or the dock if it's pinned. It doesn't show up in the the apps list in settings as installed either.

Once I reinstall or add the shortcut it's all good again. Until maybe a few hours later it just happens again for no apparent reason. It's seemingly random.

And it's just Youtube specifically, no other PWAs do this. It's really bizarre.

I ended up installing a third party app that creates web apps just for Youtube.

I like using a Youtube PWA as a separate media player in it's own window sometimes, mostly when I listen to music.

I can live with the third party app, but it would be more convenient to just have the PWA from Google Chrome itself.

Does anyone else have this odd issue?

I'm on the latest Zorin OS 17.2 Pro, with a Ryzen 7640U Framework 13 laptop, 16GB ram.

1 Like

I have never experienced this. But, it is known that Chrome PWA's have a bug with .desktop file management.

The general workaround for this is to manually create your PWA desktop file (YouTube in your case) instead of relying on the Chrome automated desktop configuration.

The Youtube PWA .desktop file should be located in your home directory in ~/.local/share/applications.youtube.desktop

The content should read

[Desktop Entry]
Name=YouTube
Exec=/usr/bin/google-chrome --profile-directory=Default --app-id=your_app_id_here
Terminal=false
Type=Application

Remove any youtube.desktop files you currently have and replace with the above. The file will be named youtube.desktop and contain the above desktop file information.

Save the file in ~/.local/share/applications.

Welcome to the Forum!

Did You tried it with an extra Program to create that? I never used them but in the Software Store, I found these 2:

Both are available as Flatpaks.

I couldn't find a youtube.desktop in that directory but I was able to find the one corresponding to Youtube.

It's named:

com.google.Chrome.flextop.chrome-agimnkijcaahngcdmfeangaknmldooml-Default.desktop

And the contents read (this is how I know it's Youtube):

#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Terminal=false
Type=Application
Name=YouTube
Exec=flatpak 'run' '--command=/app/bin/chrome' 'com.google.Chrome' '--profile-directory=Default' '--app-id=agimnkijcaahngcdmfeangaknmldooml'
Icon=chrome-agimnkijcaahngcdmfeangaknmldooml-Default
StartupWMClass=crx_agimnkijcaahngcdmfeangaknmldooml
Actions=Explore;Subscriptions
X-Flatpak-Part-Of=com.google.Chrome
TryExec=/var/lib/flatpak/exports/bin/com.google.Chrome

[Desktop Action Explore]
Name=Explore
Exec=flatpak 'run' '--command=/app/bin/chrome' 'com.google.Chrome' '--profile-directory=Default' '--app-id=agimnkijcaahngcdmfeangaknmldooml' '--app-launch-url-for-shortcuts-menu-item=https://www.youtube.com/feed/explore?feature=app_shortcuts'

[Desktop Action Subscriptions]
Name=Subscriptions
Exec=flatpak 'run' '--command=/app/bin/chrome' 'com.google.Chrome' '--profile-directory=Default' '--app-id=agimnkijcaahngcdmfeangaknmldooml' '--app-launch-url-for-shortcuts-menu-item=https://www.youtube.com/feed/subscriptions?feature=app_shortcuts'

I was able to find it by going to chrome://app-settings for Youtube and found that weird long string of letters and searched for it that applications directory.

All the other PWAs have the weirdly long random letter names like that too.

Tried to make a custom youtube.desktop with your example but it doesn't show up as an app anywhere.

Ah, I see... you installed Chrome as a Flatpak?

Hello!

Yeah I am using that first one you showed there at the moment as an alternative.

It gets the job done, but it does have some weirdness, but that's another topic. But it works and doesn't randomly Thanos Snap itself out of my computer like the Chrome one does lol.

Still prefer to have a Google Chrome one if I had to choose though, since it's integrated into my Chrome browser, and I don't need to have a whole app for that one thing.

Right, the only Google Chrome available in the Zorin OS Software app out of the box, I didn't use the terminal or any other repositories. Just what was offered out of the box in Zorin OS.

It's gotten worse. Now all my PWAs are just deleting themselves at random and I have to keep micromanaging and re-adding them.

Yeah, I think I'm just probably gonna move to another distro soon, I use PWAs a lot and this is a pain.
ZorinOS was fun while I used it though, sucks that I paid and had this experience though, sigh.

Just as a final effort, you could try installing chrome as a deb package rather than a flatpak. I know it seems weird since the others seemed to be working, but flatpaks have been known to cause some weird behaviour from time to time.

1 Like

I'll try that and see how it goes.

1 Like

I'm not familiar with installing PWAs but if it's happening to all of them it may be an issue with the browser itself. Perhaps the Flatpak version is the culprit, if you end up testing this please let us know if it works.

1 Like

Yes, manually setting the .desktop files (This prevents Gnome D.E. from cleaning them out thinking they are orphaned files) and avoiding Snap or Flatpak are the first things you should try.

Alright after a few days of testing I think I found the problem. Err, long post ahead but:

It turns out I'm an idiot.

Whenever I install Chrome on a new distro, there's always an issue with installing PWAs at first because the browser needs permission to certain file paths, namely .local/share/applications & icons

This is not unique to ZorinOS and happens on every distro I've used, starting with my introduction to Linux, the Steam Deck.
It's a very common issue and there's plenty of forums and tutorials out there on how to fix it.
I just accepted it as that's how flatpak Chrome on Linux works, no biggie it's an easy fix, I've done it a dozens of times.

The solution is to either use flatseal to add the permissions, though that's always been a hit or miss for me, or what I prefer to use, a command in the terminal.

Like a routine, after installing Chrome on ZorinOS a few months back, I just Googled the issue, jumped into some random forum, and copied and pasted the command to add the permissions in my terminal, and I was able to start making PWAs. It's what I've always done and it works.

But it turns out this time around, I was careless, and I ended up copying the wrong command into the terminal. Sort of.

I was going to give up and try out the deb package like recommended above but before that I looked at the permissions in flatseal out of curiosity, digging around.
The two .local/share/applications and icons permissions were there, but it had :create at the end of it.
That was the issue.

I googled, looked through some forums and saw the same command I copied into the terminal with :create at the end of it.

Removing that in flatseal fixed the issue.

After a few days of testing and use, none of my PWAs have been deleting themselves. Hopefully that remains the case, and I'm pretty sure it will be.

So yeah. 100% user error and carelessness, I'm an idiot :sweat_smile:

I copied and pasted the correct command into Google Keep notes so I can use it in future distros I try or when reinstalling so I don't have to Google search the issue and copy another wrong command again. Should have done that from the beginning honestly.

Well, that's that. Sorry for this long post, but yeah, problem solved. I'll keep enjoying ZorinOS and won't distro hop, lol.
At least not until next month when I upgrade my Framework laptop to the new AMD chips. Then I'll probably have to use another distro if ZorinOS isn't compatible at the start, but that's a whole different story.

Thanks for the suggestions and trying to help either way :pray:

3 Likes

This is how Flatpak packages work, not just Chrome. I'd suggest installing packages using the native Debian package format to avoid issues and headaches like this.

For Google Chrome in particular, you will have to follow the instructions listed on their website, however, as sometimes the Software store doesn't list them.