Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Register tg:// protocol #594

Closed
asdofindia opened this issue Dec 2, 2014 · 17 comments
Closed

Register tg:// protocol #594

asdofindia opened this issue Dec 2, 2014 · 17 comments

Comments

@asdofindia
Copy link
Contributor

Currently, telegram.me/username forwards to tg://resolve?domain=username on Firefox desktop.

This page says webapps can register such protocols. So, if webogram registers the tg protocol, telegram.me will work on desktop too.

@zhukov
Copy link
Owner

zhukov commented Dec 12, 2014

Thanks, will implement this as soon as will support resolving usernames

@zhukov zhukov added the ready label Dec 12, 2014
@zhukov
Copy link
Owner

zhukov commented Dec 16, 2014

It turned out that we can only register web+tg protocol, which is not good enough.
But I managed to make links work with some server-side adjustments.

@zhukov zhukov closed this as completed Dec 16, 2014
@zhukov zhukov removed the ready label Dec 16, 2014
@denilsonsa
Copy link

Since browsers do not allow registering the tg:// protocol, I've written a small user-script (AKA Greasemonkey script) to convert tg:// links into web+tg://.

Look at it:https://gist.github.com/denilsonsa/b32ee2957982bfa86a00

Install it: https://gist.github.com/denilsonsa/b32ee2957982bfa86a00/raw/telegram-tg-links-to-web-tg.user.js

Test it: http://telegramstickers.altervista.org/dr-house-sticker-pack/

@zhukov
Copy link
Owner

zhukov commented Sep 30, 2015

@denilsonsa good job! however I'm afraid this is not suitable for most of users, they usually don't want to install something.

@lapo-luchini
Copy link

I'm testing the script but it doesn't seem to work with the Chrome plugin webogram.
Is that expected?

@denilsonsa
Copy link

@lapo-luchini I don't know what is the plugin you are using. In fact, it is not a plugin, but probably a extension, or maybe a Chrome app. Could you provide the link to it?

Also, my script is extremely simple: look for all links in the page, if the link begins with tg://, replace it with web+tg://. Just that, nothing else.

@lapo-luchini
Copy link

@denilsonsa yeah, I meant the Chrome app.
And your script works perfectly, I can see the changed URL, but I guess the Chrome extension doesn't register it.

@lapo-luchini
Copy link

Actually, the Chrome app contains this (minified) code:

if(g=!0,"registerProtocolHandler"in navigator){
    try{navigator.registerProtocolHandler("tg","#im?tgaddr=%s","Telegram Web")}catch(t){}
    try{navigator.registerProtocolHandler("web+tg","#im?tgaddr=%s","Telegram Web")}catch(t){}
}

so I don't know why it is not working.

@dan-it
Copy link

dan-it commented Feb 17, 2017

Is this no longer working?
I have Firefox 51.0.1 (64-bit) and https://web.telegram.org is no longer requesting to register protocol handlers.

@zhukov
Copy link
Owner

zhukov commented Mar 13, 2017

Yeah, I've disabled it. I see no point, since only web+ is required and behaviour is different between Chrome and Fx. Also we now have fancy button on t.me pages when authorised in Telegram Web.

@PhilippBaranovskiy
Copy link

PhilippBaranovskiy commented Feb 6, 2018

@zhukov , you don't see the points, so I show you. The current (and all previous) versions of desktop TG app don't support multiple accounts.

When I click the tg;// links in my mail, vk chats, fb chats and so so so on, I want to choose what account to use to send the message, because I might use web app for one account, and desktop app for another.

This is obvious and expected result.
What is the actual result?

It drops me on t.me page, where I have to close the choosing-app-window, then click "open in web".

capture

@dan-it @lapo-luchini @denilsonsa @asdofindia

@PhilippBaranovskiy
Copy link

navigator.registerProtocolHandler("tg",
                                  "https://web.telegram.org/#/im?tgaddr=%s",
                                  "telegram Web App");

Works perfectly. So I didn't get what the problem is.
capture

@kalakamalaka
Copy link

sorry for ny English
I don't understand
href="tg://resolve?domain=@kalakamalaka" don't work
href="https://t.me/kalakamalaka" work
WHY?

@pouriap
Copy link

pouriap commented May 6, 2018

I have Firefox 51.0.1 (64-bit) and https://web.telegram.org is no longer requesting to register protocol handlers.

Yeah, I've disabled it. I see no point, since only web+ is required and behaviour is different between Chrome and Fx. Also we now have fancy button on t.me pages when authorised in Telegram Web.

I don't understand. I don't see any fancy buttons anywhere. When I click on telegram links I am redirected to a tg:// link which Firefox says it does not understand.

@rockfield's Javascript solved this perfectly. If it's so easy and straightforward I don't understand why it has been removed.
This has been bothering me for a long time since I have been completely unable to follow any telegram links with my computer.

@Kinza2018
Copy link

I am using Telegram in Opera but I can not open new web of Telegram.
Shown a window
"Unknown Protocol : Opera was unable to open the link since no application associated with "tg:" protocol was found on your system"
May be any setting problem in Opera web ?
Please to guide me. Thanks

@Kinza2018
Copy link

I have Opera version is 54.0.2952.54 & my system is 32 bit.
I am using Telegram in Opera but I can not open new web of Telegram.
Shown a window
"Unknown Protocol : Opera was unable to open the link since no application associated with "tg:" protocol was found on your system"
May be any setting problem in Opera web ?
Please to guide me. Thanks

@Kinza2018
Copy link

No body want to help me or guide me. I think in this forum every one is busy.. !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants