Reputation: 23515
I am trying to recreate the following application launch with telegram when one visits the telegram user profile page. Example: https://t.me/username1
When the page is loaded, it gives an alert box to open the telegram app. How do I recreate this as a URL link on a webpage? Also how are they doing this on page load and where is it in the source code so I can see it?
Upvotes: 0
Views: 2664
Reputation: 44093
Use tg
just like you use mailto
tg://resolve?domain=username1
<a href="tg://resolve?domain=username1">Message me!</a>
document.addEventListener("DOMContentLoaded", function(event) {
window.location.href = "tg://resolve?domain=username1";
});
Upvotes: 2