Score:1

PWA .desktop file opening new browser window instead of the app

cn flag

I've created a web app with Brave's Create shortcut tool and it appeared on my desktop as .desktop file. I've "allowed launching" but it keeps opening a new empty Brave window instead of the correct web app address.

#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Terminal=false
Type=Application
Name=YouTube
Exec=/snap/brave/123/opt/brave.com/brave/brave-browser --profile-directory=Default --app-id=agimnkijcaahngcdmfeangaknmldooml
Icon=brave-agimnkijcaahngcdmfeangaknmldooml-Default
StartupWMClass=crx_agimnkijcaahngcdmfeangaknmldooml

Ubuntu 21.04

GNOME Shell 3.38.4

Daniyal Ahmad avatar
cn flag
I am facing the same issue
Sevy avatar
cn flag
@DaniyalAhmad you have to download Brave via apt-get, not snap
Nick avatar
cn flag
On Ubuntu 22.04 this is a problem for Brave even when it is installed via the *.deb. And now Chromium is only a snap -- even when you install it via deb it still installs the snap. So using Chromium to install the PWA isn't a solution.
Score:1
cn flag

Simple solution If you want to keep the snap version.

I had found it that downloading via apt will fix the issue but then I found that brave is banned in my country (maybe because it comes with Tor), Which made it impossible to access braves website/repo without a vpn, but it meant that I will need to keep checking for updates manually and turn on and off my vpn if there is any update available, So I had to stick with the snap version.

But then I figured out a workaround.

Solution:

  • In the .desktop file that brave created change the /snap/brave/132/opt/brave.com/brave/brave-browser to brave's default executable (snap/bin/brave in my case) part from the Exec's value.
  • (Optional) Set the Icon's value of your choice (provide Icon's path), default's to Brave's Icon.
  • Move the .desktop file to /home/username/.local/share/applications.

Done! The PWA will appear as an App in the menu.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.