jssocials
jssocials copied to clipboard
Telegram sharing not working
When sharing a URL with Telegram, it opens only the general chat window - and all URLs and texts are gone.
Tested with web TG app (https://web.telegram.org/#/im), and native Android app.
My decision if someone need it:
//telegram share bug fix
setTimeout(() => {
//get current url
const url = window.location.href;
//get current title
const title = document.querySelector('.text-box').querySelector('.title').innerText;
//set share link to telegram btn
document.querySelector('.jssocials-share-telegram').querySelector('a').setAttribute('href', https://telegram.me/share/url?url=${url}&text=${title}
);
}, 1)