Tdesktop: tg:// link in firefox focuses telegram but does nothing

Created on 21 Sep 2020  路  20Comments  路  Source: telegramdesktop/tdesktop

Steps to reproduce

  1. Click on a tg:// link in firefox to join a group

Expected behaviour

Telegram should focus and join the group

Actual behaviour

Telegram focuses, but the group is neither opened nor joined

Configuration

Operating system: Arch Linux

Version of Telegram Desktop: 2.3.2

Installation source (Linux Only) - the official website / GitHub releases / flatpak / snap / distribution package: https://www.archlinux.org/packages/community/x86_64/telegram-desktop/

Used theme: Night Mode

No Logs Yet:
Insert log.txt here (if necessary)

All 20 comments

Are you sure that link that you trying to open is supported in tdesktop? Mobile clients have links that aren't supported by tdesktop afaik.

They disabled the functionality to install URL handler, so it is expected if it doesn't work
https://github.com/archlinux/svntogit-community/blob/packages/telegram-desktop/trunk/PKGBUILD#L43

Are you sure that link that you trying to open is supported in tdesktop? Mobile clients have links that aren't supported by tdesktop afaik.

Yes, it opens in Bettergram correctly.

They disabled the functionality to install URL handler, so it is expected if it doesn't work
https://github.com/archlinux/svntogit-community/blob/packages/telegram-desktop/trunk/PKGBUILD#L43

So if I toggle that flag it'll work as expected?

So if I toggle that flag it'll work as expected?

Yes, it should

But it updates the handler only when detects app update, so you will should trigger handler registration manually by entering registertg like a cheat code in settings (it won't do anything in the current build due to the flag)

What does registertg actually do? Does it add an entry in mimeapps.list so xdg-open can correctly open x-scheme-handler/tg links?

What does registertg actually do?

calls glib and it does some magic

Elaborate please

Elaborate please

I don't know what glib does under the hood exactly, but it works and other applications are using it as well

Maybe this define should be removed from the source code :thinking:

That's a good idea.

@txtsd

If you are willing and able to reproduce this issue on Arch with tdesktop 2.4.5 I would be very interested in figuring it out. If you can reproduce, please:

  1. Show the output of
$ find ~/.local/share/applications -iname '*telegram*'
$ xdg-mime query default x-scheme-handler/tg
$ grep -i telegram ~/.config/mimeapps.list
$ grep -iEo '[^;]*telegram[^;]*' ~/.local/share/applications/mimeapps.list
  1. In firefox navigate to about:config and see if a preference named network.protocol-handler.expose.tg exists

So for me it started to work after I switched the Application entry for opening tg links. If I switch it back to Use Telegram Desktop it stops working just like originally reported. If I switch it to Use Telegram Desktop (default) it starts working as intended.

Entries are shown in this screenshot:
2020-11-03-001820_1920x1080_scrot

@txtsd Thanks! Can you please provide the info requested in my previous message?

位 find ~/.local/share/applications -iname '*telegram*'

位 xdg-mime query default x-scheme-handler/tg
telegramdesktop.desktop                     

位 grep -i telegram ~/.config/mimeapps.list
x-scheme-handler/tg=telegram.desktop

位 grep -iEo '[^;]*telegram[^;]*' ~/.local/share/applications/mimeapps.list

位 

The entry in mimeapps.list was added manually.

And that pref does not exist in my about:config

Thanks @txtsd!


The .desktop file should be called telegramdesktop.desktop, not telegram.desktop as you have manually specified. Do you actually have a telegram.desktop file lurking somewhere? Please remove that from your mimeapps.list and restart firefox.


If that's not the issue, the extra entry is defined somewhere . . . possibly:

  • some glib/gsettings/dconf entry that tdesktop has unfortunately added to your system in the past
  • in firefox settings -- anything in about:config matching .tg?
  • another file that firefox checks -- any output from grep -i telegram ~/.local/share/applications/mimeinfo.cache ?

You're right about telegramdesktop.desktop. I removed the entry from mimeapps.list and restarted firefox.
Nothing in my about:config matches .tg

位 grep -i telegram ~/.local/share/applications/mimeinfo.cache

位 

I don't know how to check these -> glib/gsettings/dconf
I don't use a gnome DE, just openbox.

Yeah I'm not sure about what tdesktop might have done, as "does some magic" is the official explanation.

The extra entry in Firefox remains?

Yes, it's still there. Is there anyone more knowledgeable that you can consult?

Maybe @john-preston can enlighten us as to where that extra entry might be defined.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

LeonTheOriginal picture LeonTheOriginal  路  3Comments

whywhyy picture whywhyy  路  3Comments

ghost picture ghost  路  3Comments

Justinzobel picture Justinzobel  路  3Comments

luisalvarado picture luisalvarado  路  3Comments