JS-Share
JS-Share copied to clipboard
Telegram doesn't want to open in new window
Telegram doesn't want to open in new window. All other links working fine. How can i fix that?
Ok, i made them another way:
const pageUrl = encodeURIComponent(document.URL);
const text = encodeURIComponent(document.querySelector('meta[property="og:description"]').getAttribute('content'));
document.querySelector('[data-type="telegram"]').addEventListener('click', () => {
const url = "https://telegram.me/share/url?url=" + pageUrl + "&text=" + text;
window.open(url);
});
Mb it helps someone...