Public bug reported:

>From https://github.com/telegramdesktop/tdesktop/issues/16051

Reproduce:

1. Ensure that `text/html` in *$HOME/.config/mimeapps.list* is set to a known 
value, e.g. firefox.desktop.
2. Create a .desktop file named *telegram-desktop_telegram-desktop.desktop*. 
See below for an example file.
3. run `xdg-settings set default-url-scheme-handler tg 
telegram-desktop_telegram-desktop.desktop`
4. Now `xdg-open` or `gio open` will open any HTML file not in firefox, but 
with telegram.
5. in *$HOME/.config/mimeapps.list* the entry for `text/html` is changed to 
`text/html=telegram-desktop_telegram-desktop.desktop`.

Expected behaviour: 
HTML files are opened in firefox or the app defined before.

Actual behaviour:
HTML files are opened in Telegram (which cannot handle this).

telegram-desktop is an example, and is how I experienced this issue. I'm
not familiar enough with scheme-handlers and xdg-utils to be able to
boil down a desktop-file to the bare minimals to reproduce this. Sorry
for that.


*telegram-desktop_telegram-desktop.desktop* contents:
```
[Desktop Entry]
X-SnapInstanceName=telegram-desktop
Version=1.0
Name=Telegram Desktop
Comment=Official desktop version of Telegram messaging app
Exec=env 
BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/telegram-desktop_telegram-desktop.desktop
 /snap/bin/telegram-desktop -- %u
Icon=/snap/telegram-desktop/2551/meta/gui/icon.png
Terminal=false
StartupWMClass=TelegramDesktop
Type=Application
Categories=Chat;Network;InstantMessaging;Qt;
MimeType=x-scheme-handler/tg;
Keywords=tg;chat;im;messaging;messenger;sms;tdesktop;
```

I've gotten this file by installing telegram with snap and it is then
located at */var/lib/snapd/desktop/applications/telegram-
desktop_telegram-desktop.desktop*. I'm not sure if the desktop file
works as it references to snap directories that do not exist if
telegram-desktop is not installed.

** Affects: xdg-utils (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to xdg-utils in Ubuntu.
https://bugs.launchpad.net/bugs/1921497

Title:
  xdg-settings set default-url-scheme-handler changes the entry for mime
  type text/html

Status in xdg-utils package in Ubuntu:
  New

Bug description:
  From https://github.com/telegramdesktop/tdesktop/issues/16051

  Reproduce:

  1. Ensure that `text/html` in *$HOME/.config/mimeapps.list* is set to a known 
value, e.g. firefox.desktop.
  2. Create a .desktop file named *telegram-desktop_telegram-desktop.desktop*. 
See below for an example file.
  3. run `xdg-settings set default-url-scheme-handler tg 
telegram-desktop_telegram-desktop.desktop`
  4. Now `xdg-open` or `gio open` will open any HTML file not in firefox, but 
with telegram.
  5. in *$HOME/.config/mimeapps.list* the entry for `text/html` is changed to 
`text/html=telegram-desktop_telegram-desktop.desktop`.

  Expected behaviour: 
  HTML files are opened in firefox or the app defined before.

  Actual behaviour:
  HTML files are opened in Telegram (which cannot handle this).

  telegram-desktop is an example, and is how I experienced this issue.
  I'm not familiar enough with scheme-handlers and xdg-utils to be able
  to boil down a desktop-file to the bare minimals to reproduce this.
  Sorry for that.

  
  *telegram-desktop_telegram-desktop.desktop* contents:
  ```
  [Desktop Entry]
  X-SnapInstanceName=telegram-desktop
  Version=1.0
  Name=Telegram Desktop
  Comment=Official desktop version of Telegram messaging app
  Exec=env 
BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/telegram-desktop_telegram-desktop.desktop
 /snap/bin/telegram-desktop -- %u
  Icon=/snap/telegram-desktop/2551/meta/gui/icon.png
  Terminal=false
  StartupWMClass=TelegramDesktop
  Type=Application
  Categories=Chat;Network;InstantMessaging;Qt;
  MimeType=x-scheme-handler/tg;
  Keywords=tg;chat;im;messaging;messenger;sms;tdesktop;
  ```

  I've gotten this file by installing telegram with snap and it is then
  located at */var/lib/snapd/desktop/applications/telegram-
  desktop_telegram-desktop.desktop*. I'm not sure if the desktop file
  works as it references to snap directories that do not exist if
  telegram-desktop is not installed.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/xdg-utils/+bug/1921497/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : desktop-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to