Chatsong QR Code Banner 📥 Download QR Banner
INDIE CREATORS HUB CHATSONG
function injectBackgroundMusic() { const profile = document.querySelector('.UserCard'); if (!profile || profile.dataset.musicInjected === 'true') return; const links = profile.querySelectorAll('.UserCard-about a, .UserCard-bio a'); let embedHTML = ''; let found = false; links.forEach(link => { const href = link.href; if (href.includes('youtube.com') || href.includes('youtu.be')) { const match = href.match(/(?:v=|youtu\.be\/)([a-zA-Z0-9_-]+)/); if (match) { embedHTML = ``; found = true; } } else if (href.includes('soundcloud.com')) { embedHTML = ``; found = true; } else if (href.includes('open.spotify.com')) { const embedSrc = href.replace('/track/', '/embed/track/'); embedHTML = ``; found = true; } }); if (found) { const wrapper = document.createElement('div'); wrapper.innerHTML = embedHTML; profile.appendChild(wrapper); profile.dataset.musicInjected = 'true'; } } function setupMusicAutoplaySPA() { if (window.musicAutoplaySetup) return; window.musicAutoplaySetup = true; const rerun = () => { const profile = document.querySelector('.UserCard'); if (profile) profile.removeAttribute('data-musicInjected'); setTimeout(injectBackgroundMusic, 150); }; ['pushState', 'replaceState'].forEach(fn => { const original = history[fn]; history[fn] = function (...args) { original.apply(this, args); rerun(); }; }); window.addEventListener('popstate', rerun); } document.addEventListener('DOMContentLoaded', () => { injectBackgroundMusic(); setupMusicAutoplaySPA(); });

Powered by: FreeFlarum.
(remove this footer)