diff --git a/index.html b/index.html index 1e0a85d58b..457655a3e7 100644 --- a/index.html +++ b/index.html @@ -4,6 +4,9 @@ + + + Ping Dashboard - Cosmos Blockchain Explorer And Web Wallet { observer.observe(containerRef.value); } - // Load script only once - if (!document.querySelector('script[src="https://v1.slise.xyz/scripts/embed.js"]')) { + window.adsbyslise = window.adsbyslise || []; + window.adsbyslise.push({ slot: props.slot }); + + const sync = () => window.adsbyslisesync?.(); + const existing = document.querySelector(`script[src="${SLISE_EMBED_SRC}"]`); + + if (window.adsbyslisesync) { + sync(); + } else if (existing) { + existing.addEventListener('load', sync, { once: true }); + } else { const script = document.createElement('script'); - script.src = 'https://v1.slise.xyz/scripts/embed.js'; + script.src = SLISE_EMBED_SRC; script.async = true; + script.addEventListener('load', sync, { once: true }); document.head.appendChild(script); } - - // Initialize ad queue - window.adsbyslise = window.adsbyslise || []; - window.adsbyslise.push({ slot: props.slot }); - - // Sync if available - if (typeof window.adsbyslisesync === 'function') { - window.adsbyslisesync(); - } }); onBeforeUnmount(() => {