diff --git a/website/channel_sample.html b/website/channel_sample.html index 93824c08d9..a4f56714e1 100644 --- a/website/channel_sample.html +++ b/website/channel_sample.html @@ -12,9 +12,10 @@
>
diff --git a/website/src/js/channel-preview.jsc b/website/src/js/channel-preview.jsc index ceaa900756..7f7a12d484 100644 --- a/website/src/js/channel-preview.jsc +++ b/website/src/js/channel-preview.jsc @@ -433,6 +433,7 @@ const FORWARD_ICON_SVG = ` u.trim()).filter(Boolean); + const relayScheme = container.dataset.relayScheme || 'https'; const channelId = container.dataset.channelId || ''; const channelLink = container.dataset.channelLink || ''; @@ -445,7 +446,7 @@ function initChannelPreview(container) { container.classList.add('simplex-preview-container'); container.innerHTML = '

Loading channel...

'; - fetchPreview(relayDomains, channelId, channelLink).then(data => { + fetchPreview(relayScheme, relayDomains, channelLink, channelId).then(data => { if (!data) { container.innerHTML = '

Failed to load channel preview.

'; return; @@ -463,10 +464,10 @@ function injectStyles() { document.head.appendChild(style); } -async function fetchPreview(relayDomains, channelId, channelLink) { +async function fetchPreview(relayScheme, relayDomains, channelLink, channelId) { for (const domain of relayDomains) { try { - const url = `https://${domain}/channel/${channelId}.json`; + const url = `${relayScheme}://${domain}/channel/${channelId}.json`; const resp = await fetch(url); if (!resp.ok) continue; const data = await resp.json();