JS-Share icon indicating copy to clipboard operation
JS-Share copied to clipboard

Telegram doesn't want to open in new window

Open Kullpoint opened this issue 1 year ago • 1 comments

Telegram doesn't want to open in new window. All other links working fine. How can i fix that?

Kullpoint avatar Jul 04 '23 11:07 Kullpoint

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...

Kullpoint avatar Jul 06 '23 11:07 Kullpoint